Python入门基础--猜年龄

发布时间:2019-04-10 20:53:14编辑:auto阅读(2324)

     

    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')
    

      

关键字