Skip to content

Instantly share code, notes, and snippets.

@tomplex
Last active March 8, 2022 03:03
Show Gist options
  • Save tomplex/26b47d205c68089b5401cfba808ee017 to your computer and use it in GitHub Desktop.
Save tomplex/26b47d205c68089b5401cfba808ee017 to your computer and use it in GitHub Desktop.
from typing import List
class House:
def __init__(self, rooms: List[Room]):
self.rooms = rooms
def __len__(self):
return len(self.rooms)
def area(self) -> int:
return sum(room.area() for room in self.rooms)
house = House([])
assert len(house) == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment