while循环

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
numb = 66
print("猜测一个我想的数字,你有五次机会")
count = 1
input_numb = int(input("你猜什么"))
while count <= 5:
    if input_numb > numb:
        print("猜测的结果大了")
        = True
    elif input_numb < numb:
        print("猜测的结果小了")
        = True
    else:
        print("猜测结果正确")
        = False
        break
    count = count + 1
    if count < 6:
        input_numb = int(input('再猜'))
if a:
    print('这都猜不出来')
else:
    print('你真聪明')
posted @ 2019-01-14 15:26  大大大力水手  阅读(79)  评论(0编辑  收藏  举报