-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path005.0.py
More file actions
34 lines (34 loc) · 1.04 KB
/
Copy path005.0.py
File metadata and controls
34 lines (34 loc) · 1.04 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
import random
secret = random.randint(1,10)
temp = input('猜猜心里的逼数:')
if temp.isdigit() == 0:
print('傻子,你难道连整数都不知道是啥吗?')
temp = input('重新输入吧:')
num = int(temp)
if num == secret:
print('行行行,你是大佬你说了算')
else:
if num > secret:
print('你心里的逼数比这个小')
else:
print('你心里的逼数比这个大')
i = 1
while num != secret:
temp = input('猜错了,请重新输入:')
while temp.isdigit() == 0:
print('傻子,你难道连整数都不知道是啥吗?')
temp = input('重新输入吧:')
num = int(temp)
if num == secret:
print('行行行,你是大佬你说了算')
break
else:
if num > secret:
print('你心里的逼数比这个小')
else:
print('你心里的逼数比这个大')
i = i + 1
if i >= 3:
print('你丫猜了三次都没猜出来')
break
print('Game over')