number=33 for i in range(3): while i: guess=int(input('Enter an integer :')) if guess==number: print('Congratulations, you guessed it.') print('(but you do not win any prizes!)') break elif guess<=number-5: print('No, it is a little higher than that') elif abs(guess-number)<5: print('很接近了!') else: print('No, it is a little lower than that') else: print('test') print('Done') ------------------------------------------------------------ 第一次执行什么参数都没输入为什么会执行>>print('test') >>print('test')的缩进级别与 while 一致