Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Rock Paper Scissors\n--------------------------------")
- import random
- score_user = 0
- score_comp = 0
- #first player who reaches 10, wins the game
- while score_user<10 and score_comp<10:
- print("\n1. Rock\n2. Paper\n3. Scissors")
- choice = int(input("Enter your Choice: "))
- comp = random.randint(1,3)
- if choice == 1 and comp == 2:
- score_comp += 1
- print("Computer chose :",comp,"\nYou lose!","\nuser",score_user,"\ncomputer",score_comp)
- elif choice == 2 and comp == 3:
- score_comp += 1
- print("Computer chose :",comp,"\nYou lose!","\nuser",score_user,"\ncomputer",score_comp)
- elif choice == 3 and comp == 1:
- score_comp += 1
- print("Computer chose :",comp,"\nYou lose!","\nuser",score_user,"\ncomputer",score_comp)
- elif choice == 1 and comp ==3:
- score_user += 1
- print("Computer chose :",comp,"\nYou win!","\nuser",score_user,"\ncomputer",score_comp)
- elif choice == comp:
- print("Computer chose :",comp,"\nTie!","\nuser",score_user,"\ncomputer",score_comp)
- elif choice == 2 and comp ==1:
- score_user += 1
- print("Computer chose :",comp,"\nYou win!","\nuser",score_user,"\ncomputer",score_comp)
- elif choice == 3 and comp ==2:
- score_user += 1
- print("Computer chose :",comp,"\nYou win!","\nuser",score_user,"\ncomputer",score_comp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement