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))
Visit GitHub: https://github.com/datanota/full-stack
Comments