Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
long line solution in Clear category for Skew-symmetric Matrix by Tical_1000
def checkio(matrix):
return False if False in [matrix[i][j] == -matrix[j][i] for i in range(len(matrix))
for j in range(len(matrix))] else True
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio([
[0, 1, 2],
[-1, 0, 1],
[-2, -1, 0]]) == True, "1st example"
assert checkio([
[0, 1, 2],
[-1, 1, 1],
[-2, -1, 0]]) == False, "2nd example"
assert checkio([
[0, 1, 2],
[-1, 0, 1],
[-3, -1, 0]]) == False, "3rd example"
print("Go for it!")
Feb. 22, 2019