age1 = 90
num = 1
while num<=10:
age = int(input("请输入您的年龄:"))
if age == age1:
print("正确,结束")
num += 10
elif age > age1:
print("年龄太大了!")
else:
age < age1
print("年龄太小了!")
txt = "gla0428"
sz = 1
while sz <=3 :
txt1 = input("请输入密码:")
if str(txt1) == str(txt):
print("欢迎使用!")
sz = 4
else:
print("密码不正确,请重新输入!")
sz += 1
print("结束输入")
学习while和if 语句的嵌套使用
原文:https://www.cnblogs.com/guanla/p/13216087.html