def identidad(f,c): E=matNula(f,c) for i in range(f): E[i][i]=1 return E def matNula(f,c): m=[] for i in range(f): m.append([0]*c) return m print(identidad(5,5))
Standard input is empty
[[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!