title: Recursive Sudoku Puzzle Solver Bug
body: <p>I am writing a Sudoku puzzle solver that takes a list of lists as a &quot;puzzle&quot;, with each list representing a row in the puzzle. I create a script with several functions to handle the puzzle, yet I am running into a recursion error when I try to solve the puzzles. I believe there is an issue in the solve() function, but there may also be issues with the get_question() function, particularly with how I am handling the columns. I can attach other functions if needed.</p>
  <p>'''</p>
  <pre><code>def get_options(puzzle, row, col):
      if puzzle[row][col] &gt; 0:
          return None
      used = []
      for item in puzzle[row]:
          if item != 0:
              used.append(item)
      for i in range(len(puzzle)):
          if puzzle[i][col] != 0:
              used.append(item)
      start_row = 3 * int(row / 3)
      start_col = 3 * int(col / 3)
      for x in range(3):
          if puzzle[start_row + x] != 0:
              used.append(puzzle[start_row + x])
          for i in range(3):
              if puzzle[start_row + x][start_col + i] != 0:
                  used.append(puzzle[start_row + x][start_col + i])
      options = []
      for i in range(10):
          if i not in used:
              options.append(i)
      return options
  
  def solve(puzzle, row=0, col=0):
      if puzzle[row][col] &gt; 0:
          next_row, next_col = get_next(row, col)
          if next_row is None:
              return puzzle
          # issue here
          else:
              solve(puzzle, next_row, next_col)
      else:
          options = get_options(puzzle, row, col)
          if not options:
              return None
          else:
              for opt in options:
                  new_puzzle = copy_puzzle(puzzle)
                  new_puzzle[row][col] = opt
                  # issue here
                  result = solve(new_puzzle)
              if result is not None:
                  return result
  </code></pre>
  <p>'''</p>