Sponsored Reserved space — layout preview until AdSense is connected
hard +35 pts

Curry a function

Partial application via inspection.

Implement `curry(fn)` where calling the result with fewer args than needed returns a new function awaiting the rest.

Constraints

All positional args; fn has a fixed arity.

Example

@curry
def add(a, b, c): return a+b+c

add(1)(2)(3)  # 6
add(1,2)(3)   # 6
35 points ~30 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Use inspect.signature(fn) to get arity; collect args until len >= arity then call fn.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.
Sponsored Reserved space — layout preview until AdSense is connected