0% found this document useful (0 votes)
13 views1 page

Python Assignment 3

The document outlines an assignment for a Python programming course, detailing five tasks related to file and directory management. Tasks include creating functions to classify file paths, merge file contents, manage shelf files, move files between directories, and work with ZIP files. The assignment is due on April 30, 2024, under the subject code CIE-332T.

Uploaded by

jiyachawan73
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Python Assignment 3

The document outlines an assignment for a Python programming course, detailing five tasks related to file and directory management. Tasks include creating functions to classify file paths, merge file contents, manage shelf files, move files between directories, and work with ZIP files. The assignment is due on April 30, 2024, under the subject code CIE-332T.

Uploaded by

jiyachawan73
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Programming in Python

Assignment 3

Subject Code: CIE-332T Submission date:30-04-2024

Q1. Write a Python function named `classify_path` that takes a file path as input and categorizes it
based on the following criteria:

1. If the path is absolute, return "Absolute path".

2. If the path is a directory, return "Directory".

3. If the path is a file, return "File".

4. If the path is neither a directory nor a file, return "Invalid path".

Q2. Write a python program to only 1. Write a file without deleting its previous data.

[Link] content of two files i.e file 2 should contain content of file 1 as well as file 2.

Q3Write a python program to create shelf file and store date in it using 3 different keys and print that
data and list of all the keys. Update the date stored in key 2 and delete data of key 3 again print data
of all keys.

Q4Write a Python function called `move_files` that takes two input directory paths and moves all
files and sub directory from the first directory to the second directory and then delete the first
directory.

[Link] is ZIP file and why do we need them? Write a program to extract zip file and get all
information about that zip file.

You might also like