Last active
March 24, 2022 18:18
-
-
Save DonNeuron/e405ceef63dac21b0200557223a4d166 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| score = 0 | |
| choice = ["rock","scissors","paper"] | |
| x = random.choice(choice) | |
| def rockpaperscissors(): | |
| print(score) | |
| user1 = input("Choose rock, scissors or paper") | |
| if (x == "rock" and user1 == "rock") or (x == "paper" and user1 == "paper") or (x == "scissors" and user1 == "scissors"): | |
| print ("tie") | |
| elif (x == "rock" and user1 == "paper") or (x == "scissors" and user1 == "rock") or (x== "paper" and user1 == "scissors"): | |
| print ("you win") | |
| score+=1 | |
| elif (x == "paper" and user1 == "rock") or (x == "scissors" and user1 == "paper") or (x == "paper" and user1 == "rock"): | |
| print ("you lose") | |
| score-=1 | |
| else: | |
| print ("error, try again") | |
| rockpaperscissors() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment