Problem A: python练习题--while循环猜数字

Problem A: python练习题--while循环猜数字

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

1 .已知系统生成一个数字num=58
2.用户共有5次机会猜;
3.如果用户猜测数字大于系统给出的数字,打印"too big"
4.如果用户猜测数字小于系统给出的数字,打印"too small"
5.如果用户猜错次数超过5次,打印"guess error more then 5 times,can not guess again"
6.如果用户猜测的数字等于系统给出的数字,打印"good".并退出循环
请补充以下程序,实现功能。


num=58
ans=int(input())
i=1
while i<=5 and ans!=num:
    if                     
        print('too big')
    else:
        print('too small')
    ans=                      
    i=           
if                    :
    print('guess error more then 5 times,can not guess again')
else:
    print('good')



Input

43
50
89
58

Output

too small
too small
too big
good

Sample Input Copy

43

50

89

60

58

Sample Output Copy

too small

too small

​too big

too big

good