Module-4 python important questions
1)What is meant by compressing Files? Explain reading, extracting and creating ZIP files
with an example?
2) Define assertions. What does an assert statement in python consists of?
3). How does OS.walk( ) work in python?
4)Discuss the basicConfig( ) method to configure the lagging with an example.?
5). Write a program to depict Raising Exception.?
6)Explain the functions of Shutil module with example.?
7)How do you copy files and folders using Shutil module? Explain in detail.
8)What are Assertions? Write the contents of an assert statement. Explain them with
examples.?
9)Illustrate the logging levels in python.?
10)With suitable code, explain Backing up a Folder into a Zip file. Clearly mention the steps
involved.?
11) Explain the logging module and debug the factorial of number program.?
12)Explain the following file operation in python with example.
i) Copying files and folders
ii) Moving files and folders
iii) Permanently deleting files and folders?
13)Develop a program to sort contents of a text file
and write the forted content into a separate file?
14)Describe the file reading or writing process in python programming.?
15)Develop a program with a function named DivExp which takes Two parameters a, b and
returns a value c(c = a/b), write suitable assertion for a > 0 in function DivExp and raise an
exception for when b = 0. Develop a suitable program which reads two values from the
console and calls a function DivExp.?
16)Explain about files and folders can be copied using shutil module?
17)Explain about Debug control window?