Python Function Question and Answers PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

22PLC15B

directory.
Module-4
Q. 07 a Explain permanent delete and safe delete with a suitable Python programming
L2 08
example to each.
b Develop a program to backing Up a given Folder (Folder in a current working
L3 06
directory) into a ZIP File by using relevant modules and suitable methods.
c Explain the role of Assertions in Python with a suitable program. L2 06
OR
Q. 08 a Explain the functions with examples: (i) shutil.copytree() (ii) shutil.move()
L3 06
(iii) shutil.rmtree().
b Develop a Python program to traverse the current directory by listing sub-
L2 06
folders and files.
c Explain the support for Logging with logging module in Python. L2 08
Module-5
Q. 09 a Explain the methods __init__ and __str__ with suitable code example to
L2 06
each.
b Explain the program development concept ‘prototype and patch’ with suitable
L2 06
example.
c Define a function which takes TWO objects representing complex numbers
and returns new complex number with a addition of two complex numbers.
Define a suitable class ‘Complex’ to represent the complex number. L3 08
Develop a program to read N (N >=2) complex numbers and to compute the
addition of N complex numbers.
OR
Q. 10 a Explain the following with syntax and suitable code snippet:
i) Class definition ii) instantiation iii) passing an instance (or objects) as an L2 10
argument iv) instances as return values.
b Define pure function and modifier. Explain the role of pure functions and
L2 10
modifiers in application development with suitable python programs.
*Bloom’s Taxonomy Level: Indicate as L1, L2, L3, L4, etc. It is also desirable to indicate the COs and POs to be
attained by every bit of questions.

Page 02 of 02

You might also like