How do you write a Python code to check if the operation ā on the set {0,1,..,nā1} defined by a Cayley table is associative or not.
My attempted code is:
def is_associative_cayley_table(table):
if not is_cayley_table(table):
return False
for i in range (0,len(table)):
for j in range (0,len(table)):
for k in range (0,len(table)):
if (table[table[i][j])][k])==(table[i][(table[j][k])]):
print("Okay")
else
return False