Skip to content

Instantly share code, notes, and snippets.

@ofelix03
Created May 2, 2021 13:12
Show Gist options
  • Select an option

  • Save ofelix03/4d38a9385b2424a5a7538f40c93c0a57 to your computer and use it in GitHub Desktop.

Select an option

Save ofelix03/4d38a9385b2424a5a7538f40c93c0a57 to your computer and use it in GitHub Desktop.
class-instantiation
class Book(object):
def __init__(self, name=None, isbn=None, published_date=None, author=None):
self.name = name
self.isbn = isbn
self.author = author
# first instance of Book class
refactoring_book = Book(name='Refactor', isbn='978-0201485677')
# second instance of Book class
peaa_book = Book(name='Patterns of Enterprise Application Architecture', isbn='978-0321127426')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment