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

I don’t understand where is my mistake:

def __str__(self):
    board_str = ''
    for row in self.board:
        #row_str = [str(i) for i in row]
      row_str = ['*' if i == 0 else str(i) for i in row]

Thanks guys !

what is the link to the step please?

Modify the row_str comprehension to give a string only when the item is not zero, and an asterisk character otherwise.:

def str(self):
board_str = ‘’
for row in self.board:

      row_str = ['*' if i == 0 else str(i) for i in row]

look at the hint

“if i is truthy”

Maybe it’s expecting that you don’t use a comparison, and if that’s case it’s expecting the values in the if and else swapped

Found it !
Thanks a lot! :slight_smile: