Python Programming
Assignment #3
Marks: 25 Due Date: 25/04/2025
-------------------------------------------------------------------------------------------------------
1. Explain the difference between a class and an object. [2]
2. What is inheritance in OOP? Provide an example. [2]
3. Describe polymorphism and give an example of how it can be implemented in Python.[2]
4. What is encapsula on and how does Python achieve it? [2]
5. Explain the concept of method overriding with an example. [2]
6. What is the purpose of the __init__ method in a class? [2]
7. How do you implement mul ple inheritance in Python? [2]
8. Implement a class Student that inherits from Person and adds an a ribute student_id.
Include a method to display the student's details, including the inherited a ributes. [3]
9. Create a class Shape with a method area that returns 0. Implement two
subclasses Circle and Rectangle that override the area method to calculate the area of
the shape. [4]
10. Define a class Library with methods to add books, remove books, and display all available
books. Each book should be represented by a class Book with a ributes tle, author,
and isbn. [4]