WorksheetsPython Exceptions Quiz
Total questions: 1
Worksheet time: 7mins
What is raised when an assert statement fails in Python?
AttributeError
AssertionError
MemoryError
ReferenceError
Which exception is the base class for all exceptions in Python?
Exception
RuntimeError
IOError
BaseError
What exception is raised when a program runs out of memory?
MemoryError
OverflowError
BufferError
RuntimeError
Which exception is raised due to a system-related error in Python?
SystemError
OSError
EnvironmentError
RuntimeError
What is raised when the result of a numeric calculation is too large in Python?
ArithmeticError
MemoryError
OverflowError
FloatingPointError
What error is raised when the next() method of an iterator has no further values?
RuntimeError
StopIteration
SyntaxError
ValueError
Which error occurs due to a syntax problem?
SystemError
TypeError
SyntaxError
UnboundLocalError
When is a TypeError raised?
When there is a wrong value in a specified data type
When the sys.exit() function is called
When two different types are combined
When an error occurs that do not belong to any specific exceptions
What causes a ZeroDivisionError?
When a unicode problem occurs
When a local variable is referenced before assignment
When the second operator in a division is zero
When indentation consists of tabs or spaces
