Commit 09641b6b by BellCodeEditor

save project

parent 8a32d628
Showing with 8 additions and 7 deletions
......@@ -9,11 +9,11 @@ with open(r'C:\Users\lenovo\Desktop\qw.txt','a',encoding='utf-8')as film:
film.write('小强: 10本\n')
film.write('李明: 15本\n')
#with open(r'C:\Users\lenovo\Desktop\qw.txt','w',encoding='utf-8')as film:
# for data in film:
# print(data)
# if '小强: 10本' in data:
# data=data.replace('小强: 10本','小强: 11本')
# if '小兰:12本' in data:
# data=data.replace('小兰:12本','小兰:14本')
# new_data +=data
for data in film:
print(data)
if '小强: 10本' in data:
data=data.replace('小强: 10本','小强: 11本')
if '小兰:12本' in data:
data=data.replace('小兰:12本','小兰:14本')
new_data +=data
\ 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