fork download
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))
Success #stdin #stdout 0.04s 9580KB
stdin
Standard input is empty
stdout
[[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]]