• 2022-06-19
    下列代码中能够正确实现追加写入的是( )。
    A: with open("d:\\python\\data.txt",'w') as f: f.write('Hello!')
    B: with open("d:\\python\\data.txt",'a') as f: f.write('Hello!')
    C: with open("d:\\python\\data.txt",'r+') as f: f.write('Hello!')
    D: with open("d:\\python\\data.txt",'wb+') as f: f.write('Hello!')