IT 116: Introduction to Scripting
Quiz 8 Answers

  1. What permissions does an account need on a Python script to be able to run it without typing the name of the Python interpreter on the command line?
    read and execute permission
  2. What is the name of the special line we use to run a Python program without directly calling the interpreter?
    the hashbang line
  3. Where must this special line appear?
    the very first line of the script
  4. What are the first two characters of this special line?
    #!
  5. What must follow these two characters? I don't want the actual value, I want you to tell to describe what it is.
    the absolute pathname of the Python interpreter
  6. What is a syntax error?
    an error caused by code that does not follow the rules of the Python language
  7. What is a logic error?
    an error that causes the code to give incorrect results
  8. What is a runtime error?
    when a value in a Python statement causes the statement to fail
  9. What type of statement can be used to deal with an exception?
    a try/except statement
  10. What happens when an exception is encountered in the try block of such a statement?
    the interpreter stops running the code in the 1st block and jumps to the code in the 2nd block