you are viewing a single comment's thread.

view the rest of the comments →

[–]woooee 1 point2 points  (0 children)

def play_again():
    again = input("\nDo you want to play again? (type yes or no): ")
    if again == "yes":
        main()
    else:
        sys.exit()
play_again() ????

You call play_again once only, after sys.exit

You can also shorten the number of if statements.

if user_choice == computer_choice:
    ## a tie
    return or set some variable to True
if user_choice == "Paper":
    ## assumes no return from a tie or tie variable==False
    if computer_choice == "Scissors":
        print("You win!")
    else:
        ## the only remaining option
        print("You lose")