Learn Classes and Objects by Building a Sudoku Solver - Step 15

Tell us what’s happening:

I dont understand where the Problem here lies. Help is appreciated!

Your code so far

class Board:
    def __init__(self, board):
        self.board = board

# User Editable Region

    def find_empty_cell(self):
      for row, contents in enumerate(self.board):
        return (row, contents)

# User Editable Region

puzzle = [
  [0, 0, 2, 0, 0, 8, 0, 0, 0],
  [0, 0, 0, 0, 0, 3, 7, 6, 2],
  [4, 3, 0, 0, 0, 0, 8, 0, 0],
  [0, 5, 0, 0, 3, 0, 0, 9, 0],
  [0, 4, 0, 0, 0, 0, 0, 2, 6],
  [0, 0, 0, 4, 6, 7, 0, 0, 0],
  [0, 8, 6, 7, 0, 4, 0, 0, 0],
  [0, 0, 0, 5, 1, 9, 0, 0, 8],
  [1, 7, 0, 0, 0, 6, 0, 0, 5]
]

gameboard = Board(puzzle)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Challenge Information:

Learn Classes and Objects by Building a Sudoku Solver - Step 15

you are not asked to return anything in this step

I tried printing it but I does not pass the test either.

found the answer, I need to “pass” the test wink wink :sweat_smile:

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.