# while 循环age = 56count = 0while count < 3 : guess_age=int(input('输入年龄:')) if guess_age == age: print('猜到了') break elif guess_age > age: print('猜大了') else: print('猜小了') count +=1 if count==3: shuru=input('还玩吗(Y/N)') if shuru != 'n': count =0else: print('以输入3次,告辞') '''#从0开始循环,最大到10,步数是2for i in range(0,10,2): print(i)for i in range(10): print('---',i) for j in range(10): print(j) if j >5: break学习无止境,加油
来源:https://www.cnblogs.com/km-thonder/p/12389618.html