MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / __init__

Method __init__

example_code/item_072.py:57–62  ·  view source on GitHub ↗
(self, height, width)

Source from the content-addressed store, hash-verified

55
56class Grid:
57 def __init__(self, height, width):
58 self.height = height
59 self.width = width
60 self.rows = []
61 for _ in range(self.height):
62 self.rows.append([EMPTY] * self.width)
63
64 def get(self, y, x):
65 return self.rows[y % self.height][x % self.width]

Callers 1

__init__Method · 0.45

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected