Predicted Question Paper
Subject: Programming with Python (22616)
Time: 3 HoursTotal Marks: 70
Instructions:
- All Questions are Compulsory.
- Figures to the right indicate full marks.
- Answer each main question on a new page.
- Illustrate your answers with neat diagrams where necessary.
Q.1 Attempt any FIVE of the following: (10 marks)
a) List any four features of Python.
b) Define class and object in Python.
c) Write two differences between list and tuple.
d) What are identity and membership operators?
e) Write syntax of open() function in file handling.
f) Describe multiline comment in Python.
g) List different types of data structures used in Python.
Q.2 Attempt any THREE of the following: (12 marks)
a) Explain `if-else` and `if-elif-else` with syntax and example.
b) Write a Python program to find the factorial of a given number.
c) Explain the use of any four list methods with example.
d) Create a dictionary with student roll numbers and names. Add, update, and delete one entry.
Q.3 Attempt any THREE of the following: (12 marks)
a) Write a Python program that checks if a number is palindrome.
b) Explain the use of user-defined functions with an example.
c) Compare `readline()` and `readlines()` with examples.
d) Explain bitwise AND, OR, XOR, and NOT operators with examples.
Q.4 Attempt any THREE of the following: (12 marks)
a) Differentiate between list and dictionary (any four points).
b) Write a Python program to accept 5 integers in a list and find the largest and smallest.
c) Write a program to copy contents from "data.txt" to "backup.txt".
d) Explain any four built-in functions used with sets.
e) Write a Python program to demonstrate use of a module (e.g., math or random).
Q.5 Attempt any TWO of the following: (12 marks)
a) Write a Python program using a class `Student` with roll no and name. Display the details.
b) Explain method overloading and overriding in Python with example.
c) Explain any four file modes in Python with syntax and example.
Q.6 Attempt any TWO of the following: (12 marks)
a) Write a Python program to demonstrate multiple inheritance.
b) Create a user-defined exception to check password length (minimum 6 characters).
c) Explain the following set operations with examples: Union, Intersection, Difference, Symmetric
Difference.