Professional Documents
Culture Documents
Programming DAaa
Programming DAaa
Programming DAaa
Example 1: Define a function that takes an argument. Call the function. Identify what code is the
Example 2: Call your function from Example 1 three times with different kinds of arguments: a
Example 3: Construct a function with a local variable. Show what happens when you try to use
the error message shows that (local variables) is not defined, while it is a local variable of the
Example 4: Construct a function that takes an argument. Give the function parameter a unique
name. Show what happens when you try to use that parameter name outside the function.
The output here is clear, unlike what happened in the previous example. When I made a
parameter and defined what is the value of xxx, the result would show off if I used that
as a local variable inside a function. Explain what happens to the value of each variable as the
program runs.
Whenever the values changes, whether the inner one or the outer, they won’t effect each other’s.
For example, if the inner one changes, the outer one won’t be effects, and vice versa.