Q:

How To Think Like A Computer Scientist (Chapter 9): I don't understand the following

I'm finding difficulting what exactly the doctest in the following code is looking for in the function.
Can someone make it more clear for me, please?
Question 14:

Write functions row_times_column and matrix_mult:

def row_times_column(m1, row, m2, column):
    """
      >>> row_times_column([[1, 2], [3, 4]], 0, [[5, 6], [7, 8]], 0)
      19
      >>> row_times_column([[1, 2], [3, 4]], 0, [[5, 6], [7, 8]], 1)
      22
      >>> row_times_column([[1, 2], [3, 4]], 1, [[5, 6], [7, 8]], 0)
      43
      >>> row_times_column([[1, 2], [3, 4]], 1, [[5, 6], [7, 8]], 1)
      50
    """
def matrix_mult(m1, m2):
   """
      >>> matrix_mult([[1, 2], [3,  4]], [[5, 6], [7, 8]])
      [[19, 22], [43, 50]]
      >>> matrix_mult([[1, 2, 3], [4,  5, 6]], [[7, 8], [9, 1], [2, 3]])
      [[31, 19], [85, 55]]
      >>> matrix_mult([[7, 8], [9, 1], [2, 3]], [[1, 2, 3], [4, 5, 6]])
      [[39, 54, 69], [13, 23, 33], [14, 19, 24]]
    """

Add your new functions to matrices.py and be sure it passes the
  doctests above.

A:

Its asking you to implement some matrix multiplication methods.
In the first one, given a matrix, multiply the row of m1 x the column of m2. The first one given is:
1 2   times   5 6
3 4           7 8

but we only want row 0 times col 0, so it would be
[1 2] x 5 
        7

= 5+14 = 19. And so on for the others...
The second function wants a full matrix multiplication. See http://en.wikipedia.org/wiki/Matrix_multiplication

A:

The first function, first example in docstring: take the zeroth row from the first matrix ([1, 2]) and multiply it by the zeroth column of the second matrix ([5, 7])
1 x 5 + 2 x 7 = 19

The second function is just standard matrix multiplication. You can use the first function to answer this problem.

