Python Assignment 3
Python Assignment 3
Assignment #3
-------------------------------------------------------------------------------------------------------
1. Explain the difference between a class and an object. [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]