Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created August 20, 2023 18:41
Show Gist options
  • Save stephengruppetta/a27d8f3afd72ec3baf7f6c935257e9ba to your computer and use it in GitHub Desktop.
Save stephengruppetta/a27d8f3afd72ec3baf7f6c935257e9ba to your computer and use it in GitHub Desktop.
# schools.py
from hogwarts_magic import House
class Hogwarts:
_houses = {
"Gryffindor": House(
"Gryffindor", "Godric Gryffindor", ["scarlet", "gold"], "lion"
),
"Slytherin": House(
"Slytherin", "Salazar Slytherin", ["green", "silver"], "serpent"
),
"Ravenclaw": House(
"Ravenclaw", "Rowena Ravenclaw", ["blue", "bronze"], "eagle"
),
"Hufflepuff": House(
"Hufflepuff", "Helga Hufflepuff", ["yellow", "black"], "badger"
),
}
@classmethod
def get_house(cls, house_name):
return cls._houses.get(house_name)
@classmethod
def get_house_names(cls):
return list(cls._houses.keys())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment