Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. import random
  2.  
  3. #these will be the computers choices chosen at random for each round
  4. c = ['rock', 'paper', 'scissors']
  5. computer = random.choice(c)
  6.  
  7.  
  8. player = False
  9.  
  10. while player == False:
  11. #player can input only rock, paper, scissors
  12. player = input('rock, paper or scissors? ')
  13. if player == computer:
  14. print('You tied, try again')
  15. elif player == 'rock':
  16. if computer == 'paper':
  17. print('You lose!', computer, 'covers', player)
  18. else:
  19. print('You win!', player, 'smashes', computer)
  20. elif player == 'paper':
  21. if computer == 'scissors':
  22. print('You lose!', computer, 'cuts', player)
  23. else:
  24. print('You win!', player, 'covers', computer)
  25. elif player == 'scissors':
  26. if computer == 'rock':
  27. print('You lose!', computer, 'smashes', player)
  28. else:
  29. print('You win!', player, 'cuts', computer)
  30. else:
  31. print('Check your spelling and try again')
  32. player = False
  33. computer = random.choice(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement