易错点---所有的字符都自带bool值
所有的字符都自带布尔值,只有0,None,空为False,其他全部为真!!!!!!!!!!!
1 count = 0 2 while count < 3 : 3 inp_age =input('Enter your age: ') 4 inp_age = int(inp_age) 5 if inp_age == 18: 6 print('bingo!') 7 break 8 else: 9 print('age error') 10 count += 1 11 if count == 3: 12 inp_game = input('carry on or rall out..Y/N: ') 13 if inp_game == 'Y' or inp_game == 'y':###切记此处不可写为 inp_game == 'Y' or 'y',此时条件永远为真!!! 14 print('go on!') 15 count = 0 16 else: 17 break