Commit cfcb31de by BellCodeEditor

save project

parent d78ebe4e
Showing with 6 additions and 4 deletions
a=['hi\n''WuKong\n''i am go on spill python\n']
with open(r'c:\Users\Administrator\Desktop\ioudrbuosdkghdioaghwui.txt','a',encoding='utf-8') as file:
file.writelines(a)
print(a)
\ No newline at end of file
p
\ No newline at end of file
with open(r'C:\Users\Administrator\Desktop\彳尔 女 子.txt','r',encoding='utf-8')as file:
a=file.readlines()
final_sun=[]
for i in a:
data=i.split()
sun=0
for sales in data[1:]:
sun=sun+int(sales)
s=data[0]+str(sun)
print(s)
\ No newline at end of file
final_sun.append(s)
with open(r'C:\Users\Administrator\Desktop\彳尔 女 子.txt','a',encoding='utf-8')as file:
file.writelines(final_sun)
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