I want to define a recursive function to merge two sorted lists (these two lists are sorted) and return a new list containing all the values in both argument lists with a incre
Just a simpler version:
def combine(a, b): if a and b: if a[0] > b[0]: a, b = b, a return [a[0]] + combine(a[1:], b) return a + b
Test:
>>> combine([1,3,6,8], [2,4,5,7]) [1, 2, 3, 4, 5, 6, 7, 8]