IT 116: Introduction to Scripting
Answers to Class 12 Ungraded Quiz

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