title: python identity matrix for loop
body: <p>A program that will create a square matrix of any size the values on its diagonals are <code>1</code>, and the remaining values of the matrix are <code>0</code>.</p>
  
  <pre><code>matrix = []
  
  dimension = int (input ("Enter matrix unit size:"))
  
  for i in range (0, dimension):
       for j in range (0, dimension):
           if i == j:
               matrix.append (1)
           else:
               matrix.append (0)
          
  print (matrix)
  </code></pre>
  
  <p>I need matrix like <code>[[],[],[]]</code>, how?<br>
  <code>matrix[[i]].append(1)</code> - doesn't work</p>