Python基础课(一)

count = 0
while count < 3:
user = input("123321")
pwd = input("456654")
if user =="alex" and pwd == "123":
print("欢迎登录")
break
else:
print("用户名或者密码错误")

count = count + 1

 While 用于循环

continue 用于循环中暂停一个指定的数,不影响循环

break 用于终止循环

猜你喜欢

转载自www.cnblogs.com/Sanshuixiang/p/9278109.html