1# Program to append to text file using write() function
2with open("python.txt", "a") as file:
3 content = "Append the content at the end \n"
4 file.write(content)
5 file.close()
6
7
8# Program to read the entire file (absolute path) using read() function
9with open("C:/Projects/Tryouts/python.txt", "r") as file:
10 content = file.read()
11 print(content)
12 file.close()