Objective
Create a Python program with a function that returns another function.
Instructions
- Define
def create_multiplier(factor), which defines inside a functionmultiply(x)that returnsx * factorand returns it (without calling it). - Read the factor on the first line and, on the second, a list of integers separated by spaces.
- Create the multiplier with
create_multiplier(factor)and show on one line the results of applying it to each number, separated by spaces.
3
1 2 3 4
3 6 9 12
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise