Commit e0e05b6f by BellCodeEditor

save project

parent b6c506c5
Showing with 5 additions and 3 deletions
......@@ -3,10 +3,12 @@ with open(r'C:\Users\双师04\Documents\lesson13-1\sales_list.txt','r',encoding=
a=file.readlines()
#print(a)
for i in a:
data=i.split()
print(data[1:])
sum=0
for seles in data[1:]:
sum=sum+int(seles)
result=data[0]+str(sum)
print(result)
......
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