PWP Question Bank
PWP Question Bank
Unit 4 - 2 Marks
1) Explain Local and Global variable
4 Marks
1) Explain how to use user defined function in python with example.
2) Write a program for importing module for addition and substraction of two numbers.
3) Write a program illustrating use of user defined package in python.
4) Explain package Numpy with example.
Unit 5 - 2 Marks
1) Define class and object in python.
4 Marks
1) Write a program to create class EMPLOYEE with ID and NAME and display its contents.
2) Explain method overloading in python with example.
3) Write a program to implement the concept of inheritance in python.
Unit 6 - 2 Marks
1) List different modes of opening file in python.
4 Marks
1) Write a program to open a file in write mode and append some contents at the end of file.
2) Explain Try-except block used in exception handling in python with example.
Winter 2022
Unit 4 – 2 Marks
1) Write use of lambda function in python.
4 Marks
1) What is local and global variables? Explain with appropriate example.
2) Example module. How to define module.
Unit 5 – 2 Marks
1) Write syntax of defining class in Python
4 Marks
1) Illustrate with example method over loading.
2) Design a class student with data members; Name, roll number address. Create suitable method for
reading and printing students details
3) Create a parent class named Animals and a child class Herbivorous which will extend the class Animal. In
the child class Herbivorous over side the method feed ( ). Create a object of the class Herbivorous and call
the method feed.
Unit 6 – 2 Marks
1) List file operations in Python
4 Marks –
1) Explain how try-catch block is used for exception handling in python.
2) Write python code to count frequency of each characters in a given file
3) Write python program to read contents of abc.txt and write same content to pqr.txt.
Summer 2023
Unit 4 – 2 Marks
1) Describe any two data conversion function
4 Marks
1) Explain any four Python's Built-in Function with example.
2) Write a Python program to find the factorial of a number provided by the user.
3) Explain Module and its use in Python
4) Write a Python program to calculate sum of digit of given number using function.
Unit 5 – 2 Marks
1) With neat example explain default constructor concept in Python.
4 Marks
1) Describe 'Self' Parameter with example
2) Design a class student with data members : name, roll no., department, mobile no. Create suitable
methods for reading and printing student information
3) With suitable example explain inheritance in Python.
Unit 6 – 2 Marks
1) Describe mkdir( ) function.
4 Marks
1) With neat example differentiate between readline( ) and readlines( ) functions in file-handling.
2) Explain any four file modes in Python.
3) Write a program to show user defined exception in Python
Winter 2023
Unit 4 – 2 Marks
1) State use of namespace in python.
4 Marks
1) Write python program using module, show how to write and use module by importing it.
2) Explain Numpy package in detail
3) Write a program illustrating use of user defined package in python
Unit 5 – 2 Marks
1) Define Data Hiding concept ? Write two advantages of Data Hiding
4 Marks
1) Explain method overloading and overriding in python
2) Write a program to create class student with Roll no. and Name and display its contents
3) Write program to implement concept of inheritance in python.
Unit 6 – 2 Marks
1) State the use of read ( ) and readline ( ) functions in python file handling
4 Marks
1) Describe various modes of file object ? Explain any two in detail.
2) Explain seek ( ) and tell ( ) function for file pointer manipulation in python with example
3) WAP to read contents of first.txt file and write same content in second.txt file