-
What do you call a variable that is defined inside a function?
a local variable
-
If a variable is defined inside a function, can another function see
the value of that variable?
no
-
If a variable is defined inside a function, can the code outside
all functions see the value of that variable?
no
-
Can a variable not declared inside a function have the same name as a
variable defined inside a function?
yes
-
Can two functions have a variables with the same name?
yes
-
What do you call the variables that are listed inside the parentheses
of a function header?
parameters
-
Where do parameters get their values?
from the corresponding argument in the function call
-
Write the function header for a function named calculate_interest
that has two parameters principle and interest.
def calculate_interest(principle, interest):
-
What do you call the expressions (values), inside a function call?
arguments
-
Write the function cheer that has the single parameter team
and prints a cheer for that team.
def cheer(team):
print("Go " + team + "!")