1# Program to write to text file using write() function
2with open("python.txt", "w") as file:
3 content = "Hello, Welcome to Python Tutorial !! \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()