I am to create an old-style class with a constructor __str__, and accessor methods, such that the following code:
abook = Book(author = "Amy Doe", title = "Sun rise", price = 13.50)
print abook.getAuthor()
print abook.getTitle()
print abook.Price()
print abook
Output should be as follows:
Amy Doe
Sun Rise
13.50
Sun Rise by Amy Doe
So far I only have:
def class(book):
def __init__(self, author, title, price):
self.author = Author
self.title = Title
self.price = Price
Where does the __str__ come in?
Please help, due tomorrow.
Thanks in advance