A variable declared in the main code is a ______ variable.
A variable declared in a function is a ________ variable.
A parameter is a ________ variable.
Global and local variables differ in their _______
Code a statement that, depending on whether it occurs within a function or in the main code, determines whether purchaseTotal has global or local scope.
purchaseTotal = 3
Code something called useless that does nothing but create valueless, which has local scope.
def useless(): valueless = 0
Code a statement that assigns the value returned by a function to a global variable.
age = checkAge()
Code a function without parameters that does nothing but create two local variables.
def makeVars(): firstVar = 2 secondVar = 9
Code a statement that passes the value of a local variable to a global variable in the main code.
Code a statement that passes the values of two global variables to a function and anticipates that the function will return a value to be assigned to a new global variable. The global variable hasn't been declared beforehand.
globalVar = processNums(num1, num2)
Code a function without parameters that creates two local variables and does nothing with them. Then it (unwisely) assigns the number 10 to a global variable that you've made up without a return statement.