python if 实例:
if实例:
user_id = input("请输入用户名:")
user_pass = input("请输入密码:")
if user_id == "root":
    if user_pass =="1234":
        print("登录成功")
    else:
        print("密码输入不对")
else:
    print("用户名输入不对")
print("请重新输入用户名")
while实例:
count =0
while count <100:
    print(count)
    count = count + 1
print("循环结束")
实验:
输出:1 2 3 4 5 6 8 9 10
n = 1
while n <= 10:
    if n == 7:
        pass
    else:
        print (n)
    n = n + 1
print("---end---")
 
原文:https://www.cnblogs.com/blablablabla/p/9646406.html