Skip to content

Instantly share code, notes, and snippets.

@saumalya75
Last active August 22, 2020 12:24
Show Gist options
  • Save saumalya75/f29c9b54221e7ccb203dcdd25b0ed4ab to your computer and use it in GitHub Desktop.
Save saumalya75/f29c9b54221e7ccb203dcdd25b0ed4ab to your computer and use it in GitHub Desktop.
class House:
def __init__(self, name: str, symbol: str, student_list: list):
self.name = name
self.symbol = symbol
self.student_list = student_list
def __len__(self):
return len(self.student_list)
def __iter__(self):
return iter(self.student_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment