Commit 4d4a8f2e by BellCodeEditor

save project

parent f8981280
Showing with 26 additions and 4 deletions
a=["你好呀\n","悟空\n","我在贝尔学编程\n"] num_sum=[]
with open("hello.txt","w",encoding="utf-8")as filel: with open(r"C:\Users\Administrator","r",encoding="utf-8")as filel:
filel.writelines(a) text=filel.readlines()
\ No newline at end of file print(text)
for txt in text:
data=txt.split()
total=data[1:]
a=0
for rum in total:
a+=int(rum)
filel.append(data[0]+str(a)+"/n")
print(num_sum)
\ No newline at end of file
with open("hello.txt","r",encoding="utf-8")as filel:
a=filel.readlines()
result_list=[]
for i in a:
data=i.split()
name=data[0]
number=data[1:]
sum=0
for money in number:
sum+=int(money)
\ 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