发布时间:2019-06-22 23:47:03编辑:auto阅读(2214)
def guessnum():
guess,count=0,1
rand=random.randint(1,101)
print ('you just have five time')
guess=int(input('please enter your guess num:'))
while True:
if guess > rand:
print('too large')
elif guess < rand:
print('too small')
elif guess == rand:
print ('you are so lucky ')
break
count=count+1
print ('you just have '+str(5-count+1)+' times')
guess=int(input('please enter your num again:'))
if count == 5:
print ('sorry,your are lose,the secret num is '+str(rand))
break
上一篇: python学习--random和列表
下一篇: Python Tkinter学习之计算器
51318
50770
41364
38169
32653
29542
28387
23259
23230
21555
1629°
2364°
1968°
1911°
2240°
1947°
2641°
4427°
4268°
3038°