top of page
Search

Paradigm: Partial

Updated: Apr 27


Functional Programming



from functools import partial      
def any_given_function_with_multiple_args(**kwargs):
        user = ', '.join(f"{key}={value}" for key, value in kwargs.items())
        return f"user is: {user}"

derived_func = partial(any_given_function_with_multiple_args, first_name='Sam', last_name='Smith')
print(derived_func(age=42))










6 views

Comments


bottom of page