What is a 'Default Parameter'?

Asked by stem_mind · 2 weeks ago

1 Answer

53
amorebise · 2 weeks ago Top Answer

It’s a value that a function uses if you don't provide one. Like a restaurant that serves Jollof Rice by default unless you ask for Fried Rice.

You define it like def greet(name="Friend"):. If you just say greet(), it says "Hello Friend". It makes your functions more flexible.

Log in to add a comment.