Skip to content

yash14063/assignment4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python File Handling Assignment

This repository contains solutions for Assignment 4 on Files, Exceptions, and Errors in Python.

Files

  1. task1.py - Solution for Task 1: Reading a file with error handling
  2. task2.py - Solution for Task 2: Writing and appending to a file

Task Descriptions

Task 1: Read a File and Handle Errors

  • Opens and reads a text file named sample.txt
  • Prints its content line by line
  • Handles errors gracefully if the file doesn't exist

Task 2: Write and Append Data to a File

  • Takes user input and writes it to output.txt
  • Appends additional data to the same file
  • Reads and displays the final content

How to Run

  1. Clone this repository
  2. Run each script separately:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages