Class Book
Class Book
def display_info(self):
print(f"Book: {self.title}\n Author: {self.author} \n
ISBN: {self.ISBN}")
class BorrowableBook(Book):
def __init__(self, title, author, ISBN, borrower_name,
due_date):
super().__init__( title, author, ISBN)
self.__borrower_name = borrower_name
self.due_date = due_date
def get_borrower_name(self):
return self.__borrower_name
def display_info(self):
super().display_info()
print(f"Borrower name: {self.__borrower_name}\n Due date:
{self.due_date}")
class ReferenceBook(Book):
def __init__(self, title, author, ISBN, room_number):
super().__init__( title, author, ISBN)
self.room_number = room_number
def display_info(self):
super().display_info()
print(f"Room number: {self.room_number} ")
book1 = Book("Python Basics", "John Doe", "123-456")
book2 = Book("Open", "Andre Agassi", "0307-978")
book1.display_info()
book2.display_info()
print("\nBorrowable Book:")
book_br.display_info()
print("\nReference Book:")
book_re.display_info()