摘要:
# open w, 会覆盖文件,一般修改文件,我们会新建一个加判断修改写入新文件。不在旧文件上操作。f=open("yesterday",'r',encoding="utf-8")f_new = open("yesterday.bak",'w',encoding="utf-8")for line i 阅读全文
摘要:
'''# R+ read and writef = open("yesterday",'r+',encoding="utf-8")print(f.readline())print(f.tell())f.write(" first line ")print(f.readlines())'''#w+ w 阅读全文
摘要:
age_of_oldboy = 56for i in range(3): age = int(input("Input the age: ")) if age==age_of_oldboy: print("You got it.") break elif age > age_of_oldboy: p 阅读全文