Calmcode - recursion: function

Function

1 2 3 4 5 6

The function we ended up with is show below.

def n_paths(start=1, end=5, jumps=(1, 2)):
    if start > end:
        return 0
    if start == end:
        return 1
    return npaths(start=start + 1, end=end) + npaths(start=start + 2, end=end)