IT 116: Introduction to Scripting
Class 21 Ungraded Quiz

  1. What Python statements should you put inside the try block of a try/except statement.


  2. What Python statements should you put inside the except block of a try/except statement.


  3. When the Python interpreter comes across a runtime error inside the try bloc of a try/except statement, what does the interpreter do?


  4. Can the statements inside a try block raise more than one kind of exception?


  5. If the code inside the try block can create more than one type of runtime error, what must you do if you want to do different things for each possible runtime error?


  6. What happens whenever the Python interpreter runs some code that causes a runtime error?


  7. If you had an except block that began
    except ValueError val_err:
    how would you print the error message contained in the exception object?


  8. When is the code in the else block of a try/except statement executed?


  9. When is the code in the finally block of a try/except statement executed?


  10. What do you call the statements inside an except block?