Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- ut=ct=0
- while(ut<5 and ct<5):
- u=input("You: ")
- if(u not in "RPS"):
- print("Wrong input")
- continue
- c=random.choice("RPS")
- print("Computer: ", c)
- if u!=c:
- if ((u=="R" and c=="P") or (u=="P" and c=="S") or (u=="S" and c=="R")):
- ct+=1
- print("Computer wins","\n")
- elif ((u=="R" and c=="S") or (u=="P" and c=="R") or (u=="S" and c=="P")) :
- ut+=1
- print("You win","\n")
- print("# User= ", ut,"\n","# Computer= ",ct,"\n")
- if ut==5:
- print("Congratulations! You WON the Game")
- else:
- print("### You LOST the Game ###")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement