run_pipeline(text, steps) where steps is a list of single-argument functions, each taking a string and returning a string. Apply each function in steps to text in order (the output of one step becomes the input to the next) and return the final string. Do not use recursion; use an ordinary loop.steps = [str.strip, str.lower, lambda s: s.replace(" ", "_")]
run_pipeline(" Hello World ", steps)hello_world
strip removes outer spaces, lower lowercases, then spaces are replaced with underscores, applied in sequence.
run_pipeline("abc", [])abc
No steps means the text passes through unchanged.
Loop over steps, reassigning text = step(text) each time.
An empty steps list means the loop body never executes, so the original text is returned.