Commit a72632b2 by BellCodeEditor

save project

parent 342859dc
Showing with 9 additions and 2 deletions
...@@ -6,4 +6,12 @@ for i in h : ...@@ -6,4 +6,12 @@ for i in h :
a = i.split() a = i.split()
# print(a) # print(a)
name = a[0] name = a[0]
money = a[1:] money = a[1:]
\ No newline at end of file some = 0
new = []
for i in money:
some+= int(i)
new.append(name+":"+str(some)+"\n")
# print(name+":"+str(some))
with open(r'c:\Users\ycl77\Desktop\asdfjkl.txt','w',encoding="UTF-8") as gh:
gh.writelines(new)
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