This repository contains solutions for Assignment 4 on Files, Exceptions, and Errors in Python.
task1.py- Solution for Task 1: Reading a file with error handlingtask2.py- Solution for Task 2: Writing and appending to a file
- Opens and reads a text file named
sample.txt - Prints its content line by line
- Handles errors gracefully if the file doesn't exist
- Takes user input and writes it to
output.txt - Appends additional data to the same file
- Reads and displays the final content
- Clone this repository
- Run each script separately: