Which of the following exception is raised when the requested module definition is not found?
Which of the following exception is raised when the requested module definition is not found?
Solution
✅ Correct Option: 1
ImportError is raised when an import statement cannot find the module definition it was asked to load. It is also raised when from module import name cannot find that name in the module.
In Python 3.6 and later, a missing module raises ModuleNotFoundError, which is a subclass of ImportError.
Related questions:
2025: 3 June Shift 2
2025: 21 May Shift 1
2026: 23 May Shift 1