import random #program to simulate throwing a die until 6 is thrown #the program outputs the average number of throws it took totalThrows = 0 answer = "y" while answer == "y" or answer == "Y": numberOfThrows = 0 throw = 0 while throw != 6: throw = random.randint(1,6) numberOfThrows = numberOfThrows + 1 print("You threw a", throw) # endwhile print("That took",numberOfThrows,"throws") print("Another go? (Y or y)") answer = input() #endwhile