Python Interview Questions
  • Python - Errors & Exceptions
    1. To handle an exception you proceed problematic code with the keyword?
    A) except
    B) while
    C) try

    Answer: try
    2. You proceed code that handles an error with the keyword?
    A) try
    B) except
    C) handle

    Answer: except
    3. Keyword you should proceed problematic code to handle an error?
    A) block
    B) try
    C) except

    Answer: try
    4. Keyword used to define code to execute if an exception isn't raised?
    A) else
    B) elif
    C) except

    Answer: else
    5. Keyword used to define code you want to execute whether an exception is triggered or not?
    A) finally
    B) else
    C) final

    Answer: finally
    6. Class to inherit from when creating custom exceptions?
    A) Except
    B) Exceptions
    C) Exception

    Answer: Exception
  • python bootcamp 2021
datai analytics