Commit ed1329d7 by BellCodeEditor

auto save

parent 4a19a554
Showing with 3 additions and 2 deletions
with open(r'c:\Users\玛酷机器人编程中心\Documents\lesson13_2\sales_list.txt','r',encoding='utf-8')as file:
a=file.readlines()
z=[]
for i in a:
data=i.split()
sum=0
for s in data[1:]:
sum+=int(s)
x=data[0]+str(sum)
print(x)
\ No newline at end of file
z.a
\ 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