>>> def f(number, constants, step=0): ... if step < 2: ... return f(number + constants[step], constants, step + 1) ... else: ... return number ... >>> f(0, [1, 2]) 3 >>> f(0, [1, 2, 3]) 3 >>> f(0, [3, 4, 5]) 7 >>>