4.3.4.Graded Quiz Exception Handling - sj50179/IBM-Data-Science-Professional-Certificate GitHub Wiki

LATEST SUBMISSION GRADE 100%

Question 1

Why is the “finally” statement used?

  • Only execute the remaining code if no errors occur

  • Only execute the remaining code if one condition is false

  • Only execute the remaining code if an error occurs

  • Execute the remaining code no matter the end result

Correct

Question 2

Why is it best practice to have multiple except statements with each type of error labeled correctly?

  • To skip over certain blocks of code during execution

  • It is not necessary to label errors

  • In order to know what type of error was thrown and the location within the program

  • Ensure the error is caught so the program will terminate

Correct