Does anyone here knows how to do methods inside a class?
I need help to find:
1) a method to mark a book as completed
2 )a method to determine if the book is long (500 or more pages)
Like how do i write it?
Help is appreciated!
Update: i have wrote down the class. I just need that two method, but how do i write it?
I need help to find:
1) a method to mark a book as completed
2 )a method to determine if the book is long (500 or more pages)
Like how do i write it?
Help is appreciated!
Update: i have wrote down the class. I just need that two method, but how do i write it?
class Book: def __init__(self, title="", author="", pages=0, status=""): self.title = title self.author = author self.pages = pages self.status = status def __str__(self): return "{} by {}, total pages is {}.".format(self.title, self.author, self.pages)