Welcome to the Treehouse Community
Looking to learn something new?
Now make all Board instances iterable so we can loop through their cells attribute. If you need help, refer back to the Emulating Builtins video.
class Board: def __init__(self, width, height): self.width = width self.height = height self.cells =  for y in range(self.height): for x in range(self.width): self.cells.append((x, y)) class TicTacToe(Board): def __init__(self): super().__init__(3, 3)
Chris Christensen9,281 Points
The challenge says to review "Emulating Builtins" but it is simply underlined and not linked. The actual link is https://teamtreehouse.com/library/emulating-builtins and @kennethlove explains it at the 5:05 mark in the video.
Since this challenge is a bit separated from the "Emulating Builtins" video, it was good to go back and watch the video to understand how this challenge is solved.
Moderator Edit: Best Answer selected for this post
Use yield from self.cells when you override the iter method.
Han Xiao10,386 Points
just loop through, below works for me def iter(self): for item in self.cells: yield item
class Board: def init(self, width, height): self.width = width self.height = height self.cells =  for y in range(self.height): for x in range(self.width): self.cells.append((x, y))
# Here is the code added def __iter__(self): for cell in self.cells: yield cell
class TicTacToe(Board): def init(self): super().init(width = 3,height = 3)