Commit e92530e6 by BellCodeEditor

save project

parent 58031b73
Showing with 12 additions and 5 deletions
for i in range(1,10):
for j in range(1,i+1):
print(i,"*",j,"=",(i*j),end=" ")
print()
\ No newline at end of file
new=""
with open(r"C:\Users\Administrator\Desktop\book.txt","r",encoding="utf-8") as file:
for d in file:
if "小兰=10本" in d:
naw=d.replace("小兰=10本","小兰=12本")
new+=naw
with open(r"C:\Users\Administrator\Desktop\book.txt","w",encoding="utf-8") as file:
file.write(new)
with open(r"C:\Users\Administrator\Desktop\book.txt","r",encoding="utf-8") as file:
a=file.read()
print(a)
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