EasyPro challengePython
Closures — Make Multiplier
PythonClosuresFunctions
Implement solve(factor, x) that creates a closure internally and uses it to return x * factor.
Specifically, inside solve:
1. Define an inner function multiplier(n) that returns n * factor.
2. Return multiplier(x).
This ensures you practice writing closures — the inner function must capture factor from the enclosing scope.
Examples
solve(2, 5) # → 10 (2 × 5)
solve(2, 10) # → 20 (2 × 10)
solve(3, 7) # → 21 (3 × 7)Sample tests
Test #12 × 5 = 10
Input: [2,5]
Output: 10
Test #22 × 10 = 20
Input: [2,10]
Output: 20
Test #33 × 7 = 21
Input: [3,7]
Output: 21