Functions
To define a function in Python, you use the def
keyword.
Parameters/Arguments
Keyword Arguments
Arguments are named according to their corresponding parameters.
Order doesn't matter - Python will check the names and match them!
Values are assigned because the keyword argument and the parameter name match.
Fun fact: You can provide some arguments in positional order and some with keywords.
Positional arguments are assigned in sequential order
Keywords have to come last
return
Last updated
Was this helpful?