diff options
| -rw-r--r-- | challenge-266/steven-wilson/python/ch-2.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/challenge-266/steven-wilson/python/ch-2.py b/challenge-266/steven-wilson/python/ch-2.py index f6603f73a4..fb88e6dc17 100644 --- a/challenge-266/steven-wilson/python/ch-2.py +++ b/challenge-266/steven-wilson/python/ch-2.py @@ -14,8 +14,7 @@ def is_x_matrix(matrix): True ''' matrix_size = len(matrix) - diagonal_position = 0 - for row in matrix: + for diagonal_position, row in enumerate(matrix): antidiagonal_position = matrix_size - diagonal_position - 1 x = [] if diagonal_position < antidiagonal_position: @@ -28,7 +27,6 @@ def is_x_matrix(matrix): x.append(row.pop(antidiagonal_position)) if not all(elem != 0 for elem in x) or not all(elem == 0 for elem in row): return False - diagonal_position += 1 return True |
