Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created May 3, 2023 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephengruppetta/56097e55530da11b3f84daa766164b06 to your computer and use it in GitHub Desktop.
Save stephengruppetta/56097e55530da11b3f84daa766164b06 to your computer and use it in GitHub Desktop.
class Wizard:
def __init__(self, name, patronus, birth_year):
self.name = name
self.patronus = patronus
self.birth_year = birth_year
self.house = None
self.wand = None
# Create two wizard instances
harry = Wizard("Harry Potter", "stag", 1980)
hermione = Wizard("Hermione Granger", "otter", 1979)
print(harry.name)
# Harry Potter
print(harry.patronus)
# stag
print(hermione.name)
# Hermione Granger
print(hermione.patronus)
# otter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment