Skip to content

poojashri27/Python_Assignment_4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python_Assignment_4

Files, Exceptions, and Errors in Python

Task 1: Read a File and Handle Errors

Problem Statement: Write a Python program that:

  1. Opens and reads a text file named sample.txt.
  2. Prints its content line by line.
  3. Handles errors gracefully if the file does not exist.

Task 2: Write and Append Data to a File

Problem Statement: Write a Python program that:

  1. Takes user input and writes it to a file named output.txt.
  2. Appends additional data to the same file.
  3. Reads and displays the final content of the file.

About

Files, Exceptions, and Errors in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages