Pass an argument — quick review
A printed invitation leaves a blank after the word Dear.
A parameter is a name in the parentheses of a def line, and an argument is a value in the parentheses of a call. For the calls in this unit, Python works out the arguments, ties them to the parameters in order and then runs the body. For the functions defined in this unit, a call with fewer arguments than parameters stops with a TypeError.
Find the value in the body that should change from call to call.
Give that value a name and write the name inside the parentheses of the
defline. For two values, write two names with a comma between them.Use the names in the body where the values were.
In each call, write the values inside the parentheses in the same order as the names.
Trace a call by writing each parameter with the argument it received, then running the body with those values.
Arguments in the wrong order are the quiet mistake. label(3, "pens") is a legal call, and the program displays pens x 3. Check each call against the order of the names in the def line.
A second slip is to put quotation marks around a parameter's name in the body. Quotation marks make text, so print("name") displays the word name for every guest. Write the name without quotation marks, or inside the braces of an f-string, to use the value it holds.