File tree Expand file tree Collapse file tree
concepts/function-arguments Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,17 +71,20 @@ TypeError: concat() got some positional-only arguments passed as keyword argumen
7171
7272## Keyword Arguments
7373
74- Keyword arguments are for parameters defined with a [ default argument ] [ default arguments ] .
75- Keyword arguments can optionally be passed by their position.
74+ Keyword arguments use the parameter name when calling a function .
75+ Keyword arguments can optionally be referred to by position.
7676
77- Following is an example of keyword arguments being passed by their keyword and by position:
77+ Following is an example of keyword arguments being referred to by their parameter name and by position:
7878
7979``` python
80- >> > def concat (greeting = " Hello, " , name = " you " ):
80+ >> > def concat (greeting , name ):
8181... return f " { greeting}{ name} "
8282...
83+ # Function call using parameter names as argument keywords.
8384>> > print (concat(name = " Bob" , greeting = " Hello, " ))
8485Hello, Bob
86+ ...
87+ # Function call with positional data as arguments.
8588>> > print (concat(" Hello, " , " Bob" ))
8689Hello, Bob
8790>> > print (concat())
You can’t perform that action at this time.
0 commit comments