Median of two sorted lists

Write median(a, b) that returns the median of all values in two sorted lists combined (the middle value, or the average of the two middles), as a float. At least one list is non-empty.

median([1, 3], [2])     ->  2.0
median([1, 2], [3, 4])  ->  2.5
median([], [1])         ->  1.0

Merging is linear and passes. The interview answer binary-searches how many items of the shorter list belong in the left half, which is logarithmic; try it once the merge works.

def median(a, b):
    ...