Write a function called make_multiplier(n) that returns a lambda which multiplies its argument by n
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Write a function called make_multiplier(n) that returns a lambda which multiplies its argument by n. Create times3 = make_multiplier(3) and times5 = make_multiplier(5). Print times3(4) and times5(4).
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.