an anonymous user ·· Python
def add1(num): return num + 1 def multiply3(num): return num * 3 def add5(num): return num + 5 def calculate(fns): def composed(num): val = num for fn in fns: val = fn(val) return val return composed print(calculate([add1, multiply3, add5])(1))
Click on the Run button to get started.
The code/input has changed since you last clicked on Run. Click it again to see the updated changes.