先画流程图:
程序如下:import getpass name = ‘root‘pwd = ‘123‘for i in range(3): input_name = input("Input login username:").strip()# input_pwd = input("Input login password:").strip() input_pwd = getpass.getpass("Input login password:").strip() if (input_name == name): if (input_pwd == pwd): print("Certification successfull,Welcome to DMS manager system") break else: print("password input error!\n") else: print("Username input error!\n")else: print("Enter wrong three times %s is locked!" % input_name)
时间: 2024-10-05 06:07:15