AI engineering glossary · Python core

What is **kwargs?

**kwargs: A parameter written with a double star that gathers any extra keyword arguments into a dictionary. It lets a function accept named options it did not list, and forward them to other functions.

Level: intermediateTopic: Python core

**kwargs: an example

def show(**kwargs): print(kwargs); show(a=1, b=2) prints {'a': 1, 'b': 2}.

Related terms

More Python core terms

Where you learn it

**kwargs is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.