3
3
arr = ['rock' , 'paper' , 'scissors' ]
4
4
5
5
user_input = input (f"what's yours_choice --> 'rock', 'paper' or 'scissors'? " ).lower ()
6
-
7
6
computer_input = random .choice (arr )
8
7
9
- if computer_input == user_input :
10
- print (f'computer-{ computer_input } \n yours_choice-{ user_input } \n ------------------------\n Tied' )
11
8
12
- if computer_input == 'rock' and user_input == 'paper' :
13
- print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Won' )
14
- elif computer_input == 'paper' and user_input == 'rock' :
15
- print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Lost' )
9
+ if user_input == 'rock' or user_input == 'paper' or user_input == 'scissors' :
10
+
11
+ if computer_input == user_input :
12
+ print (f'computer-{ computer_input } \n yours_choice-{ user_input } \n ------------------------\n Tied' )
13
+
14
+ if computer_input == 'rock' and user_input == 'paper' :
15
+ print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Won' )
16
+ elif computer_input == 'paper' and user_input == 'rock' :
17
+ print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Lost' )
16
18
17
- if computer_input == 'scissors' and user_input == 'rock' :
18
- print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Won' )
19
- elif computer_input == 'rock' and user_input == 'scissors' :
20
- print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Lost' )
19
+ if computer_input == 'scissors' and user_input == 'rock' :
20
+ print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Won' )
21
+ elif computer_input == 'rock' and user_input == 'scissors' :
22
+ print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Lost' )
21
23
22
- if computer_input == 'paper' and user_input == 'scissors' :
23
- print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Won' )
24
- elif computer_input == 'scissors' and user_input == 'paper' :
25
- print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Lost' )
24
+ if computer_input == 'paper' and user_input == 'scissors' :
25
+ print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Won' )
26
+ elif computer_input == 'scissors' and user_input == 'paper' :
27
+ print (f'computer-->{ computer_input } \n yours_choice-->{ user_input } \n ------------------------\n You Lost' )
28
+ else :
29
+ print (f"Plese choose either of these options 'rock', 'paper' or 'scissors'" )
0 commit comments