Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. from random import *
  2.  
  3. name = input("Enter your Username: ")
  4.  
  5. print("Welcome {}, Welcome to the game n".format(name))
  6.  
  7. score = 0
  8.  
  9. while(score != 10):
  10.  
  11.  
  12. rndm = randint(0, 2)
  13. choice = input("Enter your choice:n 0 - rockn 1 - papern 2 - scissornYour Choice :")
  14. if choice=='0' or choice=='1' or choice=='2':
  15.  
  16. if rndm==0 and choice =='0':
  17. print("Draw")
  18. elif rndm==0 and choice=='1':
  19. print("Paper won, YOU LOSE")
  20. elif rndm==0 and choice=='2':
  21. print("Rock won, YOU WON!")
  22. score += 1
  23.  
  24.  
  25. if rndm==1 and choice =='0':
  26. print("Paper won, YOU LOSE")
  27.  
  28. elif rndm==1 and choice=='1':
  29. print("Draw")
  30.  
  31. elif rndm==1 and choice=='2':
  32. print("Scissor won, YOU WON!")
  33. score += 1
  34.  
  35. if rndm==2 and choice =='0' :
  36. print("Rock won ,you Lose")
  37.  
  38. elif rndm==2 and choice=='1':
  39. print("Scissor won, YOU Won")
  40. score += 1
  41. elif rndm==2 and choice=='2':
  42. print("Draw")
  43. else:
  44. print("____PLEASE SELECT A VALID INPUT FROM ABOVE____")
  45. break
  46.  
  47. print("score=" ,score)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement