Commit 75fdb5e5 by BellCodeEditor

save project

parent 5ec53ebb
Showing with 22 additions and 0 deletions
# file=open(r"c:\Users\玛酷机器人002\Documents\lesson13-1\sales_list.txt",'r',encoding='utf-8')
with open(r"c:\Users\玛酷机器人002\Documents\lesson13-1\sales_list.txt",'r',encoding='utf-8') as file:
a=file.readlines()
# print(a)
qwert=[]
for i in a:
s=i.split()
# print(s[0])
# print(s[1:])
sum=0
for a in s[1:]:
sum = sum+int(a)
c=s[0]+str(sum)+"\n"
qwert.append(c)
with open(r"C:\Users\玛酷机器人002\Desktop\dfsdhgysgyufgyusguyguygduygugdyrftgduytgerygti.txt","a",encoding="utf-8") as file:
file.writelines(qwert)
\ No newline at end of file
a=["你好呀\n",'悟空\n',"我在贝尔编程学python\n"]
with open(r"C:\Users\玛酷机器人002\Desktop\rgyeyeygh.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