Python入门基础--猜年龄

2020-01-20 11:15:37 浏览数 (1)

代码语言:javascript复制
age = 20
while True:
    try:
        guess_age = int(input('guess age:'))
        if guess_age > age:
            print('Is bigger')
        elif guess_age < age:
            print('Is smaller')
        elif guess_age == age:
            print('Great')
            break
    except:
        print('Wrong input')

0 人点赞