rock = ''' _______ ---' ____) (_____) (_____) (____) ---.__(___) ''' paper = ''' _______ ---' ____)____ ______) _______) _______) ---.__________) ''' scissors = ''' _______ ---' ____)____ ______) __________) (____) ---.__(___) ''' print("Welcome to ROCK PAPER SCISSORS !! ") user_choice = input("What do you choose? Type 0 for Rock, 1 for Paper or 2 for Scissors. \n") if user_choice == "0": print(f"You chose: \n {rock}") elif user_choice == "1": print(f"You chose: \n {paper}") elif user_choice == "2": print(f"You chose: \n {scissors}") import random computer_choice = random.randint(0, 2) if computer_choice == 0: print(f"computer chose:\n {rock}") elif computer_choice == 1: print(f"computer chose:\n {paper}") elif computer_choice == 2: print(f"computer chose:\n {scissors}") if user_choice == "0" and computer_choice == 1: print("You lose") elif user_choice == "1" and computer_choice == 2: print("You lose") elif user_choice == "2" and computer_choice == 0: print("You lose") elif user_choice == "1" and computer_choice == 0: print("You won!") elif user_choice == "2" and computer_choice == 1: print("You won!") elif user_choice == "0" and computer_choice == 2: print("You won!") elif user_choice == "0" and computer_choice == 0: print("It's a tie!") elif user_choice == "1" and computer_choice == 1: or elif computer_choice == user_cchoice print("It's a tie!") print("It's a Tie!") elif user_choice == "2" and computer_choice == 2: print("It's a tie!")
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter