首页 > 其他 > 详细

文件操作_用户登陆问题

时间:2018-09-01 16:18:07      阅读:159      评论:0      收藏:0      [点我收藏+]
# 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 = 0
while 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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!