import random d1 = random.randint(1,6) d2 = random.randint(1,6) s = d1 + d2 ts = 0 e = 0 r = 1 if d1 == 1 and d2 == 1 : print('game over') print('your final score is 0') else : print('Roll', r, '----------------------') print('You roll', d1, 'and', d2) print('Your score is', s) print('Your total score is', ts) y = input('Do you want to roll again? y/n ') while y == 'y' and e != 1 : r = r + 1 ts = ts + s d1 = random.randint(1,6) d2 = random.randint(1,6) s = d1 + d2 if d1 == 1 and d2 == 1 or y == 'n': print('game over') print('your final score is 0') e = 1 else : print('Roll', r, '----------------------') print('You roll,', d1, 'and', d2) print('Your score is', s) print('Your total score is', ts) y = input('Do you want to roll again? y/n ')