title: Add two matrices in python
body: <p>I'm trying to write a function that adds two matrices to pass the following doctests:</p>
  
  <pre><code>  &gt;&gt;&gt; a = [[1, 2], [3, 4]]
    &gt;&gt;&gt; b = [[2, 2], [2, 2]]
    &gt;&gt;&gt; add_matrices(a, b)
    [[3, 4], [5, 6]]
    &gt;&gt;&gt; c = [[8, 2], [3, 4], [5, 7]]
    &gt;&gt;&gt; d = [[3, 2], [9, 2], [10, 12]]
    &gt;&gt;&gt; add_matrices(c, d)
    [[11, 4], [12, 6], [15, 19]]
  </code></pre>
  
  <p>So I wrote a function:</p>
  
  <pre><code>def add(x, y):
      return x + y
  </code></pre>
  
  <p>And then I wrote the following function:</p>
  
  <pre><code>def add_matrices(c, d):
      for i in range(len(c)):
          print map(add, c[i], d[i])
  </code></pre>
  
  <p>And I <em>sort</em> of get the right answer. </p>