0

How do I make a unitary matrix in python 3 using lists and sublists?

I was trying to make a unitary matrix, (a square grid the size defined by the user and to have the diagonal from left to right become ones and I couldn’t make it only change the diagonal with: for i in len(matrix): Matrix[i][i]=1 Please help I can’t use imports and it should be simple ( the most advanced things would be functions and sublists for this, sorry for the limitations.

28th Apr 2019, 7:13 AM
Lucas
Lucas - avatar
3 Réponses
0
Sorry I, didn’t specify but cant use imports only self made programs
28th Apr 2019, 7:19 AM
Lucas
Lucas - avatar
0
If I have to use it in a quiz I wont be able to though
28th Apr 2019, 7:22 AM
Lucas
Lucas - avatar
0
Oh nice thanks a bunch
28th Apr 2019, 7:29 AM
Lucas
Lucas - avatar