Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- #vWin - Number of wins
- #vNum - Number of games played
- name = input('Hey enter your name ?')
- print ('whats up' , name , '!')
- print ('ready to play rock paper scissors')
- vWin = 0
- vNum = 0
- while True:
- try:
- print ('Your wins:' , vWin , 'Total games:' , vNum)
- UserPick = int(input('Press 1 for Rock, 2 for Paper, or 3 for Scissors !'))
- ComputerPick = random.randrange(1,3)
- if UserPick == ComputerPick:
- print('We have a draw folks!')
- vNum = vNum + 1
- elif UserPick == 1 and ComputerPick == 2:
- print('Computer wins, Paper beats Rock')
- vNum = vNum + 1
- elif UserPick == 1 and ComputerPick == 3:
- print('You win ! Rock beats Scissors')
- vNum = vNum + 1
- vWin = vWin + 1
- elif UserPick == 2 and ComputerPick == 1:
- print('You win ! Paper beats Rock')
- vNum = vNum + 1
- vWin = vWin + 1
- elif UserPick == 2 and ComputerPick == 3:
- print('Computer wins, Scissors beats Paper')
- vNum = vNum + 1
- elif UserPick == 3 and ComputerPick == 1:
- print('Computer wins, Rock over Scissors')
- vNum = vNum + 1
- elif UserPick == 3 and ComputerPick == 2:
- print('You Win ! Scissor beats Paper')
- vNum = vNum + 1
- vWin = vWin + 1
- except:
- print (' gg in the chat')
- print ('You picked:' , UserPick , 'Computer Picked:' , ComputerPick)
- print ('Your wins:' , vWin , 'Total games:' , vNum)
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement