Write a definition for a class Book. The Book class has data attributes for a title, an

Question:

Write a definition for a class Book. The Book class has data attributes for a title, an author name and the number of pages. The class also has the following methods:

a. An _ _init_ _ method for the class. The method should accept arguments for each of the data attributes.

b. A special _ _len_ _ method to return the number of pages in the book.

c. An _ _str_ _ method that returns a string showing the state of the object.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: