Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
One possible program:
import random
rolls = 0
while True:
first_die = random.randint(1, 6)
second_die = random.randint(1, 6)
rolls += 1
print(first_die, second_die)
if first_die == second_die:
break
print("Rolls until doubles:", rolls)