AI engineering glossary · Python core

What is default argument?

Default argument: A parameter given a value in the function definition that is used when the caller omits it. Defaults make parameters optional. They are evaluated once, when the function is defined.

Level: beginnerTopic: Python core

Default argument: an example

def greet(name, greeting='Namaste'): return f'{greeting}, {name}'. greet('Ravi') uses the default 'Namaste'.

Related terms

More Python core terms

Where you learn it

Default argument 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.