Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created May 15, 2023 19:36
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/3be804b6098a08d3836e1242121e790e to your computer and use it in GitHub Desktop.
Save stephengruppetta/3be804b6098a08d3836e1242121e790e to your computer and use it in GitHub Desktop.
# hogwarts_magic.py
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
def assign_wand(self, wand):
self.wand = wand
print(f"{self.name} has a {self.wand} wand.")
class House:
def __init__(self, name, founder, colours, animal):
self.name = name
self.founder = founder
self.colours = colours
self.animal = animal
self.members = []
self.points = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment