def is_identity_element mtr for in xrange for in xrange if mtr or mtr

1
2
3
4
5
6
7
8
def is_identity_element (mtr, n):
for e in xrange (n):
for j in xrange (n):
if mtr[e][j] != j or mtr[j][e] != j:
break
else:
return True
return False