Commit 84a766cf by BellCodeEditor

save project

parent 54ba20ed
Showing with 12 additions and 3 deletions
...@@ -3,10 +3,19 @@ ...@@ -3,10 +3,19 @@
# file.write('大\n') # file.write('大\n')
# file.close() # file.close()
new_data=" "
with.open(r'C:\Users\Student-A08\Desktop\555.txt','a',encoding='utf-8') as file1: with.open(r'C:\Users\Student-A08\Desktop\555.txt','a',encoding='utf-8') as file1:
for data in file1: for data in file1:
if '小'in data: if '小'in data:
print("如果话里话外") data=data.replace("小""大")
for data in file1: for data in file1:
if '大'in data: if '大'in data:
print("如果话里话外") data=data.replace("小""大")
\ No newline at end of file new_data +=data
with.open(r'C:\Users\Student-A08\Desktop\555.txt','a',encoding='utf-8') as file1:
file1.write(new_data)
with.open(r'C:\Users\Student-A08\Desktop\555.txt','a',encoding='utf-8') as file1:
a= file1.read()
print(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