Python provides functions to handle files: opening, reading, writing, and closing files.
file = open("example.txt", "w") # Open a file in write mode
file.write("Hello, World!")
file.close() # Close the file
file = open("example.txt", "r") # Open file in read mode
content = file.read()
print(content) # Output: Hello, World!
file.close()