forked from rohanmittal149/Python_Examples
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRandom_generator.py
More file actions
Latest commit
32 lines (23 loc) · 547 Bytes
/
Copy pathRandom_generator.py
File metadata and controls
32 lines (23 loc) · 547 Bytes
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
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
importrandom
i=random.randint(1,10)
whileTrue:
j=int(input("Pick Number from 1 to 10: "))
ifj>10:
print("Number is greater than 10")
elifi>j:
print("TOO LOW!!")
elifj>i:
print("TOO HIGH!!")
else:
print("You Won!!")
k=input("Wanna play again(y/n): ").lower()
ifk=='y':
i=random.randint(1,10)
continue
else:
print("Thanks for playing!!")
break
# In[ ]: