티스토리 뷰

파이썬/예외 처리

파이썬 예외 처리

코린이도이 2020. 11. 4. 16:38

예외의 종류

프로그래밍 언어의 오류

  1. 구문 오류(syntax Error)

    • 프로그램 실행 전에 발생하는 오류

    • 이클립스, 파이참 등 통합개발환경 도구에서는 자동으로 실행 전에 오류를 체크함

  2. 논리적 오류(Logical Error) 혹은 런타임 오류(Runtime Error)

    • 프로그램 실행 중에 발생하는 오류

    • 문법적으로 틀린 것이 없으므로, 즉시 인식되지 않지만 의도치 않은 결과를 초래할 수 있음

파이썬 내장 예외 종류

 

Built-in Exceptions — Python 3.9.0 documentation

Built-in Exceptions In Python, all exceptions must be instances of a class that derives from BaseException. In a try statement with an except clause that mentions a particular class, that clause also handles any exception classes derived from that class (b

docs.python.org

  • StopIteration, ImportError, NameError, SyntaxError 등
  • 계층 구조로 이루어져 있음

'파이썬 > 예외 처리' 카테고리의 다른 글

파이썬 예외 처리 실습해보기  (0) 2020.11.04
예외 처리 방법  (0) 2020.11.04
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함