Last active
May 17, 2020 09:51
-
-
Save raeq/ccc9e2e83969f6e68d0b628b87cd8c2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple class example. | |
""" | |
class Book: | |
""" | |
A simple book class. | |
""" | |
def __init__(self, isbn: str, title: str, author: str): | |
""" | |
The constructor | |
""" | |
self.isbn = isbn | |
self.title = title | |
self.author = author | |
self.page = 0 | |
self.notes = [] | |
def set_note(self, note: str, page: int)-> int: | |
""" | |
Sets a reader note. | |
""" | |
self.notes.append((note, page)) | |
def goto_page(self, page_number: int): | |
""" | |
Sets the current page number. Maximum of 1000. | |
""" | |
if page_number < 1000 > 0: | |
self.page = page_number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment