-
-
Save stephengruppetta/a445fd4997cbdf2e821871dec4f94052 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.") | |
def assign_house(self, house): | |
self.house = house | |
house.add_member(self) | |
class House: | |
# ... | |
def add_member(self, member): | |
self.members.append(member) | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment