📂 File Handling & Exception Handling Assignment
📌 Overview
This project demonstrates Python file handling (reading & writing files) and exception handling (catching and managing errors). It is divided into two parts:
- File Read & Write Challenge 🖋️
Reads a file.
Modifies the content (e.g., converts to uppercase).
Writes the modified content into a new file.
- Error Handling Lab 🧪
Asks the user for a filename.
Handles errors such as:
File not found.
No permission to read.
Other unexpected errors.
⚙️ How It Works
-
The program prompts the user for the name of an existing file.
-
It attempts to open and read the file.
-
The content is modified (in this case, converted to uppercase).
-
The modified text is written into a new file called:
modified_.txt
- If the file doesn’t exist or can’t be opened, the program shows a friendly error message.
🎯 Learning Objectives
Understand how to read and write files in Python.
Learn to use try-except blocks for exception handling.
Improve error-handling practices for user-friendly programs.