-
-
Save stephengruppetta/60d34dc031aa315a995f9fec362d3f41 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: | |
# ... | |
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 | |
def add_member(self, member): | |
self.members.append(member) | |
def remove_member(self, member): | |
self.members.remove(member) | |
def update_points(self, points): | |
self.points += points | |
def get_house_details(self): | |
return { | |
"name": self.name, | |
"founder": self.founder, | |
"colours": self.colours, | |
"animal": self.animal, | |
"points": self.points | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment