forked from sumedha3111/Python-for-Beginners
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
Latest commit
50 lines (33 loc) · 1.05 KB
/
Copy pathscript.py
File metadata and controls
50 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#random module is imported here for getting random options
importrandom
options= ['rock', 'paper', 'scissor']
defrandom_generator():
returnrandom.choice(options)
user_choice=input('Enter your choice (rock,paper,scissor): ')
user=user_choice.lower()
computer=random_generator()
ifuser=='rock'or'paper'or'scissors':
print("The computer has drawn %s and you have drawn %s"% (computer,user))
ifuser==options[0]:
ifcomputer==options[2]:
print('\nResult:User win :)')
elifcomputer==user:
print('\nGame is DRAW !')
else:
print('\n Result:User Lose :(')
elifuser==options[1]:
ifcomputer==options[0]:
print('\nResult: User win :)')
elifcomputer==user:
print('\n\nGame is DRAW')
else:
print('\nResult:User lose :(')
elifuser==options[2]:
ifcomputer==options[1]:
print('\nResult: User win :)')
elifcomputer==user:
print('\nGame is DRAW')
else:
print('\nResult:User lose :(')
else:
print('\nWRONG CHOICE')