第12180题 单选
Python中以下哪种文件打开方式可以实现将新日志信息追加到文件末尾?
A
with open('test.txt', 'w') as f:
f.write('new text')
B
with open('test.txt', 'a') as f:
f.write('new text')
C
with open('test.txt', 'r') as f:
f.write('new text')
D
with open('test.txt', 'rb') as f:
f.write('new text')
提交0次 正确率0.00%
答案解析