請說出下面代碼結果及緣由,很easy。python
說明:test.txt文件不存在spa
with open('test.txt','w+') as f: f.write('34') f.seek(0) f.write('12') f.seek(0) print(f.read())
輸出結果及緣由: blog
with open('test.txt','a+') as f: f.write('34') f.seek(0) f.write('12') f.seek(0) print(f.read())
輸出結果及緣由:it
with open('test.txt','a+') as f: f.write('3456789') f.seek(2) f.truncate(3) f.write('12') f.seek(0) print(f.read())
輸出結果及緣由: class