Commit 6dd0caa2 by BellCodeEditor

auto save

parent d096516e
Showing with 17 additions and 6 deletions
with open('c:\\Users\\Administrator\\Documents\\lesson13-1\\sales_list.txt',"r",encoding="utf-8")as a: with open(r"C:\Users\学生账户\Documents\lesson13-4\sales_list.txt","r",encoding="utf-8")as a:
b=a.readlines() b=a.readlines()
for i in b: for i in b:
data=i.split() data=i.split(',')
print(data[1:]) sum=0
for a in data[1:]:
sum=sum+int(a)
print(data[0]+str(sum))
\ No newline at end of file
1111111111111 a,86
\ No newline at end of file b,58
c,84
d,84
e,65
r,54
n,56
m,64
h,16
\ 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