Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
Two fair dice (1–6 each). Keep “rolling” with random.randint until both show the same value (doubles). Count how many rolls (pairs of dice) that took, including the doubles roll.
Print each pair if you like, or only the count.
Skills: while, two random values, equality test.