System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q1061: The sys.exit() function is used to ________.
- A: terminate the program
- B: handle runtime errors
- C: cause overflow errors
- D: detect system errors
View Answer
A
Q1062: The exception type that handles unexpected errors not classified elsewhere is ________.
- A: RuntimeError
- B: OSError
- C: SystemExit
- D: ReferenceError
View Answer
A
Q1063: OSError typically indicates ________.
- A: a failure in system level operations
- B: an overflow in arithmetic calculations
- C: a problem with weak references
- D: an internal interpreter fault
View Answer
A
Q1064: OverflowError happens when ________.
- A: the result of an arithmetic operation exceeds the allowable range
- B: a system operation fails
- C: a weak reference is accessed
- D: the interpreter encounters an internal fault
View Answer
A
Q1065: In Python exception handling, the block that runs if no exception occurs is called ________.
- A: try
- B: except
- C: else
- D: finally
View Answer
C
Q1066: Which block is used to catch a specific exception in Python?
- A: try
- B: else
- C: except
- D: finally
View Answer
C
Q1067: The purpose of the try block in Python exception handling is to ________.
- A: handle exceptions
- B: define variables
- C: execute code that may cause exceptions
- D: skip errors
View Answer
C
Q1068: If an ExceptionI occurs, which block is executed in the Python exception sequence?
- A: try
- B: except ExceptionI
- C: else
- D: finally
View Answer
B
Q1069: The else block in Python exception handling executes when ________.
- A: an exception occurs
- B: no exception occurs
- C: any exception occurs
- D: finally block is skipped
View Answer
B
Q1070: In Python, multiple except blocks can be used to handle different ________.
- A: exceptions
- B: variables
- C: functions
- D: classes
View Answer
A