import random def roll_dice(): return random.randint( 1, 6 ), random.randint( 1, 6 ) def display_roll(dice1, dice2): print(f"you roll {dice1} and {dice2}") def main(): print("welcome to snake eyes!") input("press enter to have a roll...") total_score = 0 roll_number = random.randint roll_again = 'y' while roll_again.lower() == 'y': dice1, dice2 = roll_dice() display_roll(dice1, dice2) if dice1 == 1 and dice2 == 1: print("snake eyes! you lose!") total_score = 0 break total_score += dice1 + dice2 print(f"your total score is now {total_score}") roll_again = input("Roll again? (y/n): ") print(f"Thanks for playing! your final score is {total_score}") if __name__ == "__main__": main()