Files, Exceptions, and Errors in Python
- Opens and reads a text file named sample.txt.
- Prints its content line by line.
- Handles errors gracefully if the file does not exist.
- Takes user input and writes it to a file named output.txt.
- Appends additional data to the same file.
- Reads and displays the final content of the file.