|
| 1 | +import random |
| 2 | + |
| 3 | +arr = ['rock', 'paper', 'scissors'] |
| 4 | + |
| 5 | +user_input = input(f"what's yours_choice --> 'rock', 'paper' or 'scissors'? ").lower() |
| 6 | + |
| 7 | +computer_input = random.choice(arr) |
| 8 | + |
| 9 | +if computer_input == user_input: |
| 10 | + print(f'computer-{computer_input}\nyours_choice-{user_input}\n------------------------\nTied') |
| 11 | + |
| 12 | +if computer_input=='rock' and user_input=='paper': |
| 13 | + print(f'computer-->{computer_input}\nyours_choice-->{user_input}\n------------------------\nYou Won') |
| 14 | +elif computer_input=='paper' and user_input=='rock': |
| 15 | + print(f'computer-->{computer_input}\nyours_choice-->{user_input}\n------------------------\nYou Lost') |
| 16 | + |
| 17 | +if computer_input=='scissors' and user_input=='rock': |
| 18 | + print(f'computer-->{computer_input}\nyours_choice-->{user_input}\n------------------------\nYou Won') |
| 19 | +elif computer_input=='rock' and user_input=='scissors': |
| 20 | + print(f'computer-->{computer_input}\nyours_choice-->{user_input}\n------------------------\nYou Lost') |
| 21 | + |
| 22 | +if computer_input=='paper' and user_input=='scissors': |
| 23 | + print(f'computer-->{computer_input}\nyours_choice-->{user_input}\n------------------------\nYou Won') |
| 24 | +elif computer_input=='scissors' and user_input=='paper': |
| 25 | + print(f'computer-->{computer_input}\nyours_choice-->{user_input}\n------------------------\nYou Lost') |
0 commit comments