turbo6412

random Book Class

Nov 6th, 2021
1,087
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. """
  2. This module will act as a class to hold book objects and print its properties.
  3. """
  4.  
  5.  
  6. class Book:
  7.     """
  8.    This class will store each book property and have a method to
  9.    print those properties for debugging purposes.
  10.    """
  11.  
  12.     def __init__(self, title: str, date: object, author: str, length: int):
  13.         """ This constructor will initialize all the book properties. """
  14.         self.title = title
  15.         self.date = date
  16.         self.author = author
  17.         self.length = length
  18.  
  19.     def print_book_props(self):
  20.         """ This print_book_props function will print the book properties to help debug. """
  21.         print(self.title, self.date, self.author, self.length)
  22.  
Advertisement
Add Comment
Please, Sign In to add comment