def compose(*functions):
    composed = lambda x: x
for function in reversed(functions):
    composed = lambda x, function=function, composed=composed: function(
        composed(x))
return composed
print(compose(f, g)(5))
RecursionError composing lambdas