Commit 0c1b5dd9 by BellCodeEditor

save project

parent 7475d22c
Showing with 11 additions and 4 deletions
...@@ -2,6 +2,13 @@ with open(r'C:\Users\Administrator\Documents\lesson13_2\sales_list.txt','r',enco ...@@ -2,6 +2,13 @@ with open(r'C:\Users\Administrator\Documents\lesson13_2\sales_list.txt','r',enco
a=file.readlines() a=file.readlines()
# print(a) # print(a)
for i in a: for i in a:
print(i) b=i.split()
# b=i.split() # print(b[1:])
# print(b[1:]) sum = 0
\ No newline at end of file for c in b[1:]:
# print(c)
sum +=int(c)
w = b[0]+str(sum)
print(w)
\ 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