猜年龄做个循环
age=36 guessage=int(input('Please guess my age:')) while guessage!=age: if guessage<age: print('you need bigger') guessage=int(input('Please guess my age again:')) elif guessage>age: print('you need smaller') guessage=int(input('Please guess my age again:')) else:print('you got it')
#出现过的错误是在循环的时候没有重新赋值。