Q20Comprehension5 Marks3 Sep 2023
Passage
Based on the above data, answer the given subquestions. Consider the class Product:
```
class Product:
def __init__(self, title, price):
self.title = title
self.price = price
def change_price(self, price):
self.price = price
def print_info(self):
print(f'Product title: {self.title}')
print(f'Product price: {self.price}')
Book is a sub-class of Product:
class Book(Product):
count = 0
def __init__(self, title, price, author, genre):
super().__init__(title, price)
self.author = author
self.genre = genre
Book.count += 1
def is_fiction(self):
return self.genre == "Fiction"
def print_info(self):
super().print_info()
print('Product is a book')
print(f'Author: {self.author}')
print(f'Genre: {self.genre}')
```
What is the output of the following snippet of code?
```
book = Book('Wings of Fire', 250, 'Dr. Kalam', 'Non Fiction')
book.change_price(300)
book.print_info()
```