Already Passed
Can the `except` block handle multiple types of exceptions?
✔✔Yes
What is the correct way to re-raise an exception in Python?
✔✔Using the `raise` keyword without specifying an exception
What exception is raised when a function receives an argument of the wrong type?
✔✔`TypeError`
What exception is raised when a function is called with the wrong number of arguments?
✔✔`TypeError`
How do you create a custom exception with a message?
✔✔By defining a class that inherits from `Exception` and passing the message during
initialization
1
, What does the `pass` statement do in an `except` block?
✔✔It allows the block to do nothing and continue execution
What is the purpose of catching exceptions?
✔✔To handle errors and allow the program to continue running
What does the `IndexError` exception handle?
✔✔An attempt to access an index that is out of range in a sequence
What exception is raised when Python runs out of memory?
✔✔`MemoryError`
Can a `try` block exist without an `except` block?
✔✔Yes, if it has a `finally` block
What is a common use case for the `finally` block?
✔✔To release external resources like file handles or database connections
2