# username = input("please enter your name:")# passport = input("please enter your passport:") # with open("list of info",mode="w", encoding="utf-8" ) as f:# f.write("{}\n{}".format(username,passport)) # print("congratulations")lis = []i = 0while i < 3: uname = input("please enter your username:") passwd = input("please enter your password:") with open("list of info", "r", encoding="utf-8") as f: for line in f: lis.append(line) if uname == lis[0].strip() and passwd == lis[1].strip(): print("Login sucessfully") break else: print("wrong") i += 1
原文地址:https://www.cnblogs.com/jly1/p/9570678.html
时间: 2024-10-30 03:04:31