✅ Module 5: Previous Year (Likely) Questions
(Based on Chapters 15, 16, 17 of Think Python: Classes and Objects)
🔹 Theory Questions (5–10 Marks)
1. Define a class in Python. Explain how attributes are assigned and accessed with an
example.
2. What are pure functions and modifiers? Explain with an example using a Time class.
3. Write a class to represent Time in hours, minutes, and seconds. Add methods to print and
increment time.
4. Explain the __init__() and __str__() methods with suitable examples.
5. What is operator overloading? Illustrate using __add__() method with a class.
6. Explain the concept of polymorphism with example.
7. Write a Python program to define a Rectangle class with methods to compute area and
perimeter.
8. What is type-based dispatch? How is it used in Python?
9. Discuss the difference between interface and implementation in object-oriented
programming.
10. Explain how objects are mutable and how object copying can be done.
🔹 Programming Questions (Lab-style / 10 Marks)
1. Define a class Student with attributes: name, USN, and marks in 3 subjects. Include
methods to calculate total and percentage.
2. Write a Python class Time to represent time and include a method to add two Time
objects.
3. Implement operator overloading for addition and equality (+, ==) in a custom class.
4. Create a class Complex to represent complex numbers. Add methods for addition and
display.
5. Define a Rectangle class with width and height. Write methods to calculate area and
display rectangle info.