Python game loop
I've made a simple dice game which works perfectly but i'm trying to give the user the option to play again, the issue i have is when the user types "Y" it prints the original statement and i want to bypass it and just play again, i've included my code to make it easier to understand: from random import randint def game(): dice = randint(2, 12) start_game = False name = input('What is your name? ') win = 0 lose = 0 while start_game is False: print('Hello', name, 'welcome to the dice game, ' 'you have 2 dice to roll, 7 or higher you win, 6 or lower you lose, do you want to play?') answer = str.upper(input('Y/N: ')) if answer == 'Y': start_game = True if dice < 7: print('You rolled', dice, 'you lose!!') lose += 1 print('Wins: ', win, '\nLosses: ', lose) again = input('Want to play again? Y/N: ').upper() if again == 'N': exit() elif again == 'Y': start_game = False else: print('You rolled', dice, 'you win!!') win += 1 print('Wins: ', win, '\nLosses: ', lose) again = input('Want to play again? Y/N: ').upper() if again == 'N': exit() elif again == 'Y': start_game = False elif answer == 'N': print('Bye!') exit() else: print('Pick again:') if __name__ == '__main__': game()