SHARE
TWEET

rockpapersci

GreatRaymondo Jul 22nd, 2019 (edited) 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from random import randint
  2.  
  3. player = input('rock (r), paper(p) or scissors (s)?')
  4.  
  5. print(player, 'vs', end=' ')
  6.  
  7. chosen = randint(1,3)
  8. #print(chosen)
  9.  
  10. if chosen == 1:
  11.   computer = 'r'
  12.  
  13. elif chosen == 2:
  14.   computer = 'p'
  15.  
  16. else:
  17.   computer = 's'
  18.  
  19. print(computer)
  20.  
  21. if player == computer:
  22.   print('DRAW! ')
  23.  
  24. elif player == 'r' and computer == 's':
  25.   print('Take that sucker! ')
  26.  
  27. elif player == 'r' and computer == 'p':
  28.   print('Computer wins haha" ')
  29.  
  30. elif player == 'p' and computer == 'r':
  31.   print('Take that sucker! ')
  32.  
  33. elif player == 'p' and computer == 's':
  34.   print('Computer wins haha! ')
  35.  
  36. elif player == 's' and computer == 'r':
  37.   print('Computer wins haha! ')
  38.  
  39. elif player == 's' and computer == 'p':
  40.   print('Take that sucker! ')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top