Advertisement
WarriorWolf

Untitled

Aug 23rd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. from random import choice
  2.  
  3. options = ['rock', 'paper', 'scissor']
  4. option = int(input('Choose your option: \n'
  5.                    '[1] Rock\n'
  6.                    '[2] Paper\n'
  7.                    '[3] Scissor\nYour Option: '))
  8. option_pc = choice(options)
  9.  
  10.  
  11. def vencedor(option, option_pc):
  12.     if option == 1 and option_pc == 'scissor':
  13.         print(f'The pc chose {option_pc} and you chose Rock. YOU WIN!')
  14.     elif option == 2 and option_pc == 'rock':
  15.         print(f'The pc chose {option_pc} and you chose Paper. YOU WIN!')
  16.     elif option == 3 and option_pc == 'paper:':
  17.         print(f'The pc chose {option_pc} and you chose Scissor. YOU WIN!')
  18.     elif option == option_pc:
  19.         print(f'The pc chose {option_pc} and you chose {option}. Nobody win')
  20.     else:
  21.         print(f'The pc chose {option_pc} and you chose {option}. YOU LOSE')
  22.  
  23.  
  24. vencedor(option, option_pc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement