Advertisement
Guest User

Untitled

a guest
Jul 16th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.61 KB | None | 0 0
  1. import random
  2. #vWin - Number of wins
  3. #vNum - Number of games played
  4.  
  5. name = input('Hey enter your name ?')
  6.  
  7. print ('whats up' , name , '!')
  8.  
  9. print ('ready to play rock paper scissors')
  10.  
  11. vWin = 0
  12. vNum = 0
  13. while True:
  14.     try:
  15.         print ('Your wins:' , vWin , 'Total games:' , vNum)
  16.         UserPick = int(input('Press 1 for Rock, 2 for Paper, or 3 for Scissors !'))
  17.         ComputerPick  = random.randrange(1,3)
  18.         if UserPick == ComputerPick:
  19.             print('We have a draw folks!')
  20.             vNum = vNum + 1
  21.         elif UserPick == 1 and ComputerPick == 2:
  22.             print('Computer wins, Paper beats Rock')
  23.             vNum = vNum + 1
  24.         elif UserPick == 1 and ComputerPick == 3:
  25.             print('You win ! Rock beats Scissors')
  26.             vNum = vNum + 1
  27.             vWin = vWin + 1
  28.         elif UserPick == 2 and ComputerPick == 1:
  29.             print('You win ! Paper beats Rock')
  30.             vNum = vNum + 1
  31.             vWin = vWin + 1
  32.         elif UserPick == 2 and ComputerPick == 3:
  33.             print('Computer wins, Scissors beats Paper')
  34.             vNum = vNum + 1
  35.         elif UserPick == 3 and ComputerPick == 1:
  36.             print('Computer wins, Rock over Scissors')
  37.             vNum = vNum + 1
  38.         elif UserPick == 3 and ComputerPick == 2:
  39.             print('You Win ! Scissor beats Paper')
  40.             vNum = vNum + 1
  41.             vWin = vWin + 1
  42.        
  43.     except:
  44.         print (' gg in the chat')
  45.         print ('You picked:' , UserPick , 'Computer Picked:' , ComputerPick)
  46.         print ('Your wins:' , vWin , 'Total games:' , vNum)
  47.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement