Ok just a couple of things:
-This will be better inside a method called validate_sudoku
-If the sudoku is invalid, why continue with the next lines of code? why we don't stop the execution