Skip to content

princeigho74/Week4_Python_File_Handling-Assignment-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

📂 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:

  1. File Read & Write Challenge 🖋️

Reads a file.

Modifies the content (e.g., converts to uppercase).

Writes the modified content into a new file.

  1. 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

  1. The program prompts the user for the name of an existing file.

  2. It attempts to open and read the file.

  3. The content is modified (in this case, converted to uppercase).

  4. The modified text is written into a new file called:

modified_.txt

  1. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages