IT 116: Introduction to Scripting
Quiz 5 Answers

  1. If you were calculating a running total, which would be stored in a variable named total, what value would you assign to this variable at the start of the program?
    0
  2. What is the augmented assignment operator that adds the value on its right to the value of the variable on its left and assigns that new value to the variable?
    +=
  3. What is a void function?
    a function that does not return a value
  4. What do you call the functions that are always available in Python and DO NOT have to be imported?
    built-in functions
  5. What do you call a variable that is defined inside a function?
    a local variable
  6. If a variable is defined inside a function, can another function see the value of that variable?
    no
  7. What do you call the variables that are listed inside the parentheses of a function header?
    parameters
  8. Where do parameters get their values?
    from the corresponding argument in the function call
  9. Write the function header for a function named calculate_interest that has two parameters principle and interest.
    def calculate_interest(principle, interest):
  10. What do you call the expressions (values), inside a function call?
    arguments