Commit 1c23520e by BellCodeEditor

save project

parent eeda0174
Showing with 7 additions and 1 deletions
...@@ -2,5 +2,10 @@ with open(r'c:\Users\Admin\Documents\lesson13-1\sales_list.txt','r',encoding='ut ...@@ -2,5 +2,10 @@ with open(r'c:\Users\Admin\Documents\lesson13-1\sales_list.txt','r',encoding='ut
a=xjb.readlines() a=xjb.readlines()
for i in a: for i in a:
new_i=i.split() new_i=i.split()
print(new_i[1:]) #print(new_i[1:])
sum=0
for sales in new_i[1:]:
sum=sum+int(sales)
xjb2=new_i[0]+str(sum)
print(xjb2)
\ 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