Commit ac40905a by BellCodeEditor

save project

parent be24fb24
Showing with 16 additions and 6 deletions
q="I have a apple"
s=q.replace('a a','three a')
print(s+ q)
...@@ -5,12 +5,17 @@ with open(r'C:\Users\Administrator\Desktop\faq.txt','w',encoding='utf-8')as f0: ...@@ -5,12 +5,17 @@ with open(r'C:\Users\Administrator\Desktop\faq.txt','w',encoding='utf-8')as f0:
with open(r'C:\Users\Administrator\Desktop\faq.txt','a',encoding='utf-8')as f0: with open(r'C:\Users\Administrator\Desktop\faq.txt','a',encoding='utf-8')as f0:
f0.write("小强:114本") f0.write("小强:114本")
with open(r'C:\Users\Administrator\Desktop\faq.txt','r',encoding='utf-8')as f0: n=''
a=f0.read()
print(a)
for asswecan in f0: with open(r'C:\Users\Administrator\Desktop\faq.txt','r',encoding='utf-8')as f0:
#a=f0.read()
#print(a)
for asswecan in f0:
if "小强:114本" in asswecan: if "小强:114本" in asswecan:
print("Y + \n*7 + YOOOOOOOOOOOOOO-------------") asswecan=asswecan.replace("114","514")
print(asswecan)
n=n+asswecan
#print("Y + \n*7 + YOOOOOOOOOOOOOO-------------")
with open(r'C:\Users\Administrator\Desktop\faq.txt','w',encoding='utf-8')as f0:
f0.write(n)
\ 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