title: List iterations Python
body: <p>Im trying to work on a popular python question - rotating a 2D list. Given a <code>list = [[1,2,3,4],[5,6,7,8],[12,13,14,15]]</code>.</p>
  
  <p>I know a very simple solution exists which is : <code>zip(*list[::-1]</code>. But I wanted to create my own function. So i go this:</p>
  
  <pre><code>def flip(list):
      output = []
      temp = len(list)
      for row in range(temp):
          newlist = []
          for col in range(temp):
              newlist.append(list[col][temp - row - 1])
              print list[col][temp - row -1]
          output.append(newlist) 
  </code></pre>
  
  <p>But this only works when we have an <code>n*n</code> matrix. What should I change if I have a<code>m*n</code> matrix . What am i doing wrong here</p>