title: Matrix Transformation For Loop
body: <p>So the image of a matrix can be transformed, for the rows and columns to this rule:</p>
  
  <p>The Values in the first row of the original matrix become the values of the last column of the image matrix. The Values in the second row of the original matrix become the values of the second last column of the image matrix …. and so on ...until the values in the last row of the original matrix become the values of the first column of the image matrix.</p>
  
  <p>As a diagram, the left hand matrix is the original and the right hand matrix is its image.</p>
  
  <pre><code> [['a', 'b', 'c'],           [['g', 'd', 'a'],
    ['d', 'e', 'f'],            ['h', 'e', 'b'],
    ['g', 'h', 'i']]            ['i', 'f', 'c']] 
  </code></pre>
  
  <p>Assume the following already exist in Python:</p>
  
  <p>matrix: a 3 x 3 list of lists representing a matrix of numbers (similar to the examples above)</p>
  
  <p>image: a list the same size as matrix, containing only empty sub-lists (for storing the matrix image)</p>
  
  <p>indexes: a list containing the integers 0, 1 and 2 (i.e., valid index positions of both matrix, and image)</p>
  
  <p>Complete the following code to return the image of matrix according to the above rule.</p>
  
  <pre><code>for row in indexes:
      for ____ in ____:
          image[row].append(matrix[____] [____])
  </code></pre>
  
  <p>The options are:</p>
  
  <pre><code>row
  col
  0
  1
  2
  len(indexes)
  indexes
  2 - col
  2 - row
  col - 2
  row - 2
  len(matrix)
  </code></pre>
  
  <p>Any of the options can be used above in the blank spots. My gut after my times of learning python tells me that I should try to answer the question as such:</p>
  
  <pre><code>for row in indexes:
      for col in indexes:
           image[row].append([col][row])
  </code></pre>
  
  <p>What i think will happen is that it'll take all the values, and switch em out for row -> column and column -> row. Am i somewhat correct or completely off?</p>