Commit 01ced5c2 by BellCodeEditor

save project

parent ad5e5b2c
Showing with 8 additions and 4 deletions
......@@ -3,7 +3,12 @@ with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',enco
a=sales_list.readlines()
# print(a)
for i in a:
print(i)
# print(i)
p=i.split()
print(p[0])
print(p[1:])
\ No newline at end of file
# print(p[0])
# print(p[1:])
sum=0
for sales in p[1:]:
sum=sum+int(sales)
k=p[0]+str(sum)
print(k)
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