输入用户名密码;
登入成功后提示欢迎信息;
三次登入失败后锁定。
编写如下:
# Author: Ewan Wangfor i in range(3): username = input("username:") password = input("password:") if username =="Wang"and password =="123": print("Welcome to the new world!") break else: print("Username or password is wrong,please re-enter...")else: print("The system has been locked.")
时间: 2024-10-10 03:55:23