Commit 8276177d by BellCodeEditor

save project

parent a8d02629
Showing with 23 additions and 0 deletions
# 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16本'
#a=open(r'D:\邱子恒\ a.txt','w',encoding='UTF-8')
#a.write('小兰:12本\n,小丽:11本\n,李文:9本\n,张伟:16本\n')
#a.close()
# with open(r'D:\邱子恒\ a.txt','a',encoding='UTF-8') as a:
# a.write('小强:10本\n,李明:11本')
wa=''
with open(r'D:\邱子恒\a.txt','r',encoding='utf-8') as a:
for i in a:
if '小强:10本' in i:
i=i.replace('小强:10本','小强:11本')
wa+=i
with open(r'D:\邱子恒\a.txt','w',encoding='utf-8') as a:
a.write(wa)
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.shape("square")
pen.forward(200)
pen.right(90)
pen.forward(200)
turtle.done()
\ 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