1.问询是否继续
age_of_oldboy =56
count =0
while count <3:
guess_age =int(input('guess age of oldboy:'))
if guess_age == age_of_oldboy:
print('yes,you got it!')
break
elif guess_age > age_of_oldboy:
print('think smaller!')
else:
print('think bigger')
count +=1
if count ==3:
continue_confirm =input('do you want to keep guessing..?')
if continue_confirm !='n':
count =0
else:
print('you have tried too many times..fuck off')
2.
#Continue:跳出本次循环,进入下一次循环,直到整个循环结束
#break:结束整个循环
for iin range(0,10):
if i <3:
print('loop:',i)
else:
continue
print('hehe',i)