Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created June 29, 2023 14:13
Show Gist options
  • Save stephengruppetta/60ec99e3a43abc074712c01faac3971f to your computer and use it in GitHub Desktop.
Save stephengruppetta/60ec99e3a43abc074712c01faac3971f to your computer and use it in GitHub Desktop.
class Book:
def __init__(self, title, author, publication_year):
self.title = title
self.author = author
self.publication_year = publication_year
class Library:
def __init__(self):
self.books = []
def add_books(self, books):
"""
Add books to the library
:param books: list (or other sequence) of Book objects
"""
self.books.extend(books)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment