Skip to content

Instantly share code, notes, and snippets.

@temmyzeus
Last active January 20, 2022 23:23
Show Gist options
  • Save temmyzeus/98817a89745b46b0fdee510ae394dba6 to your computer and use it in GitHub Desktop.
Save temmyzeus/98817a89745b46b0fdee510ae394dba6 to your computer and use it in GitHub Desktop.
class Item:
# parameters for instance variables are defined in the __init__ function
def __init__(self, item_name, price):
self.item_name = item_name
self.price = price
# instance variables are defined when the class is instantiated or created
burger = Item(item_name='burger', price=2.55)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment