Commit d0eb2162 by BellCodeEditor

save project

parent f11238be
Showing with 7 additions and 2 deletions
...@@ -5,8 +5,12 @@ for i in a: ...@@ -5,8 +5,12 @@ for i in a:
print(data[1:]) print(data[1:])
for sales in data[1:]: for sales in data[1:]:
sum=sum+int(sales) sum=sum+int(sales)
result=data[0]+str(sum) result=data[0]+str(sum)+'\n'
print(result) final_sum.append(result)
a=['你好呀\n','悟空\n','我在贝尔编程学python\n']
with open(r'C:\Users\admin\Desktop\hello.txt','a',encoding = 'utf-8')as file:
file.writelines(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