【python】注册登录实例

name=input("请输入账号")
password=input("请输入密码")
with open("d:\\a100.txt",mode="w",encoding='UTF-8') as f:
f.write("{}\n{}".format(name,password))
i=0
li = []
while i < 3:
n = input("请输入账号")
m = input("请输入密码")
with open("d:\\a100.txt", mode="r", encoding='UTF-8') as f:
for i in f:
li.append(i)
if n == li[0].strip() and m == li[1].strip():
print("登录成功")
break
else:print("账号密码错")
i = i + 1
上一篇:简洁的标点符号并分成单词python


下一篇:1706.球会落何处