본문 바로가기
Python(Eng. ver)

18. Python Error Handling

by 곽정우 2024. 3. 19.

1. Exception

An exception is an unexpected problem or error that can occur during program execution. When an exception occurs, the program is interrupted. Therefore, it is important to handle exceptions appropriately to prevent program interruption and provide error information to the user.

 

2. Basic Structure of Exception Handling

 

User can handle all exceptions without specifying an error code after 'except'.

 

 

3. Exception class

The Exception class is the base class for almost all built-in exceptions in Python's built-in exception hierarchy. This class provides a basic interface for creating custom exceptions or catching specific exception types.

 

4. Creating and Using Custom Exception Classes

 

'Python(Eng. ver)' 카테고리의 다른 글

20. File I/O in Python  (0) 2024.03.20
19. Python Module  (0) 2024.03.20
17. Special Method  (0) 2024.03.19
16. Inheritance in Python  (0) 2024.03.19
15. Object-oriented programming and Class  (0) 2024.03.18