Extra key-value pairs in parameters
**kwargs
def f(name, **kw):
print(name)
print(kw)
f(name="Foo", a=23, b=12)
f(a=23, name="Bar", b=12)
Output:
Foo
{'a': 23, 'b': 12}
Bar
{'a': 23, 'b': 12}
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
**kwargs
def f(name, **kw):
print(name)
print(kw)
f(name="Foo", a=23, b=12)
f(a=23, name="Bar", b=12)
Output:
Foo
{'a': 23, 'b': 12}
Bar
{'a': 23, 'b': 12}