0% found this document useful (0 votes)
172 views

Python Function Question and Answers PDF

This document contains exam questions related to Python programming. It includes questions about permanent and safe file deletion, backing up folders to ZIP files, using assertions, shutil module functions for copying, moving and deleting directories, traversing directories, logging modules, class definitions, instantiation, passing instances as arguments and return values, pure functions vs modifiers, and complex number arithmetic. The questions cover a range of Python concepts from the basics to more advanced OOP and testing techniques.

Uploaded by

RAJESH
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
172 views

Python Function Question and Answers PDF

This document contains exam questions related to Python programming. It includes questions about permanent and safe file deletion, backing up folders to ZIP files, using assertions, shutil module functions for copying, moving and deleting directories, traversing directories, logging modules, class definitions, instantiation, passing instances as arguments and return values, pure functions vs modifiers, and complex number arithmetic. The questions cover a range of Python concepts from the basics to more advanced OOP and testing techniques.

Uploaded by

RAJESH
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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