Commit 305f7fc9 by BellCodeEditor

save project

parent a8d02629
Showing with 21 additions and 0 deletions
# file.write("小兰:12本\n小丽:11本\n李文:9本\n张伟:16本")
file = open(r"C:\Users\Windows 10\Desktop\xs.txt","w",encoding="utf-8")
#file.write("\n小强:12本\n李明:15本")
# abc = file.read()
# for i in abc:
# print(i)
# with open(r"C:\Users\Windows 10\Desktop\xs.txt","r",encoding="utf-8") as file:
# a = file.read()
# for i in a:
# print(i)
# sy = "12345"
# print(sy)
# sy1 = sy.replace("12345","54321")
# print(sy1)
sy = "小兰:12本\n小丽:11本\n李文:9本\n张伟:16本\n小强:12本\n李明:15本"
sy1 = sy.replace("12","14")
sy1 = sy.replace("12","11")
file.write(sy1)
\ 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