Commit e98979f2 by BellCodeEditor

auto save

parent 13273784
Showing with 31 additions and 0 deletions
f = open("test1.py","w",encoding="utf-8")
f.write("#@TSNBEHERGTFRGERGKHGGH")
f.close()
f=open("test.py",encoding="utf-8")
ls = f.readlines()
f.close()
f = open("test.py",encoding="utf-8")
j = len(ls)
for i in range(j):
line=f.readlines()
if line[0] == "#":
print(f"以#开头行行:{1+1}")
else:
print(line,end="")
f.close()
f = open("test.py",encoding="utf-8")
ls = f.readlines()
for index,line in enumerate(ls):
if line,startswith("#"):
print(f"以#开头行行:{index+1}"")
else:
print(line.end="")
f.close()
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