Python Programming - Reading and Writing Files - Discussion

Discussion Forum : Reading and Writing Files - General Questions (Q.No. 82)
82.
How can you append the text "Additional content" to an existing file named "existing.txt"?
with open("existing.txt", "a") as file:
    file.write("Additional content")
append_text("existing.txt", "Additional content")
with open("existing.txt", "w") as file:
    file.append("Additional content")
with open("existing.txt", "a") as file:
    file.append("Additional content")
Answer: Option
Explanation:
Using open() in append mode to add content to an existing file.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.