Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import *
- name = input("Enter your Username: ")
- print("Welcome {}, Welcome to the game n".format(name))
- score = 0
- while(score != 10):
- rndm = randint(0, 2)
- choice = input("Enter your choice:n 0 - rockn 1 - papern 2 - scissornYour Choice :")
- if choice=='0' or choice=='1' or choice=='2':
- if rndm==0 and choice =='0':
- print("Draw")
- elif rndm==0 and choice=='1':
- print("Paper won, YOU LOSE")
- elif rndm==0 and choice=='2':
- print("Rock won, YOU WON!")
- score += 1
- if rndm==1 and choice =='0':
- print("Paper won, YOU LOSE")
- elif rndm==1 and choice=='1':
- print("Draw")
- elif rndm==1 and choice=='2':
- print("Scissor won, YOU WON!")
- score += 1
- if rndm==2 and choice =='0' :
- print("Rock won ,you Lose")
- elif rndm==2 and choice=='1':
- print("Scissor won, YOU Won")
- score += 1
- elif rndm==2 and choice=='2':
- print("Draw")
- else:
- print("____PLEASE SELECT A VALID INPUT FROM ABOVE____")
- break
- print("score=" ,score)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement