I have a set of functions f(x), g(x), s(x), t(x).
They are designed to be chained together like this: f(g(s(t(x))))
The functions are designed so they can be chained in any sequence. Another part of my code builds the sequence in a list: [f, g, s, t]
Is there an elegant way to take the list and chain the function calls, getting the output of the last result?
Now obviously I can do it using an outside counter-like variable which tracks the output and a simple for loop increment index, but I was wondering if there is an more Pythonic way to do this?