-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbook.py
More file actions
28 lines (25 loc) · 1.33 KB
/
book.py
File metadata and controls
28 lines (25 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Book:
def __init__(self, title = "Alice in Wonderland", author = "Lewis Carroll", release_date = "January, 1991", last_update_date = "October 12, 2020", language = "English", producer = "Arthur DiBianca and David Widger", book_path= "data/books_data/11-0.txt"):
"""
This is the constructor method of the book class which constructs a book objects
:param title: the title of book
:param author: the author of the book
:param release_date: the release date of the book
:param last_update_date: the last update date of the book
:param language: the language of the book
:param producer: the producer of the book
:param book_path: the path of where the book is located
"""
self.title = title
self.author = author
self.release_date = release_date
self.last_update_date = last_update_date
self.language = language
self.producer = producer
self.book_path = book_path
def __str__(self):
"""
This method returns the string representation of book object in the specified format
:return: (formatted) string
"""
return f'{self.title};;;{self.author};;;{self.release_date};;;{self.last_update_date};;;{self.language};;;{self.producer};;;{self.book_path}'