Working of Append Mode

Let's see how the append mode works:

Example 1 :

print("Example - 1") file = open('append_mode_file.txt','a') file.write('Hi, I am the appended mode statement') file.close()

Output:

Hi, I am the appended mode statement

There are also various other commands in Python file handling that are used to handle various tasks: