Commit 80fd3b65 by BellCodeEditor

save project

parent bafe842b
Showing with 15 additions and 11 deletions
with open('C:\Users\CM\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') username = "python"
a=file.readlines() userpassword = "123456"
while True:
for i in a: name = input("请输入用户名")
data=i.split() password = input("请输入密码")
sum=0 if name == username and password == userpassword:
for sales in data[1:] print("登陆成功")
sum=sum+int(sales) break
result = data[0]+str(sum) if name !=username:
print(result) print("用户名错误,请重新输入")
\ No newline at end of file continue
if password !=userpassword:
print("密码输入错误,请重新输入")
print("欢迎来到编程")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment