Dynamic Keyword Arguments in Python?

Yes, It does. Use **kwargs in a function definition.

Example:

def f(**kwargs):
    print kwargs.keys()


f(a=2, b="b")     # -> ['a', 'b']
f(**{'d'+'e': 1}) # -> ['de']

But why do you need that?

Leave a Comment