求解:文件写入问题
with open('z.txt','w') as f:print(f.write("hello"))
在python中,我写入的是"hello",为什么不能输出"hello",而是输出5??
2019-05-29 14:59
2019-05-29 15:26
2019-05-29 16:26
2019-06-12 14:17
程序代码:f = open('C:\\Users\\25448\\Desktop\\1.txt', 'w')
f.write('hello')
f.close()
f1 = open('C:\\Users\\25448\\Desktop\\1.txt', 'r')
print(f1.read())
f.close()

2019-06-21 01:09

2019-06-21 01:11