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')
a=file.readlines()
for i in a:
data=i.split()
sum=0
for sales in data[1:]
sum=sum+int(sales)
result = data[0]+str(sum)
print(result)
\ No newline at end of file
username = "python"
userpassword = "123456"
while True:
name = input("请输入用户名")
password = input("请输入密码")
if name == username and password == userpassword:
print("登陆成功")
break
if name !=username:
print("用户名错误,请重新输入")
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