Commit 31d0f55a by BellCodeEditor

auto save

parent f07183f2
Showing with 8 additions and 2 deletions
with open(r"c:\Users\ColaMaster\Documents\lesson13-1\sales_list.txt","r",encoding = "utf-8") as file: with open(r"c:\Users\ColaMaster\Documents\lesson13-1\sales_list.txt","r",encoding = "utf-8") as file:
str = file.readlines() str = file.readlines()
for i in str: for i in str:
print(i) data = i.split(" ")
\ No newline at end of file a = data[1:]
sum = 0
for num in a:
sum = sum + int(num)
result =data[0] + str(num)
print(result)
\ 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