Bài tập Args & Kwargs - Nâng cao
Các bài tập về *args và **kwargs - Nâng cao
def log_calls(func):
pass
@log_calls
def add(a, b, c=0):
return a + b + c
# Test: should log arguments và return valuedef curry(func, *args):
# Partial application
pass
# Test
def add_three(a, b, c):
return a + b + c
add_5 = curry(add_three, 5)
result = add_5(10, 15)
print(result) # 30Last updated