...
 
Commits (2)
class Bookshelf:
def __init__(self, books):
self.books=books
self.book_storage = []
self.add_book()
#method to add books to bookshelf (book_storage)
def add_book(self):
for x,y in self.books:
......@@ -18,13 +12,6 @@ class Bookshelf:
for book in self.book_storage:
print (book)
class Book:
def __init__(self,title,author):
self.title=title
......@@ -33,19 +20,10 @@ class Book:
def __str__(self):
return f"{self.title} by {self.author}"
#book1=Book("title1", "author1")
#print(book1)
book_shelf=Bookshelf(books=[('The old man and the see', 'Ernest Hemingway'),
('Beyond Good and Evil', 'Friedrich Nietzsche'),])
#print(book_shelf)
\ No newline at end of file
#print(book_shelf)