반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- string
- google apps script
- 파이썬
- Python
- gas
- numpy
- Java
- math
- GIT
- PANDAS
- Google Excel
- Presto
- Kotlin
- PySpark
- list
- hive
- django
- matplotlib
- Apache
- Redshift
- Tkinter
- Github
- dataframe
- c#
- PostgreSQL
- array
- Google Spreadsheet
- SQL
- Excel
Archives
- Today
- Total
목록python raise (1)
달나라 노트
Python Basic : raise (강제로 Error 발생시키기)
Python에서 어떠한 이유로 강제로 Error를 발생시켜야 한다면 raise keyword를 사용할 수 있습니다. raise syntax raise Exception("error_message") 구문은 위와 같습니다. Exception의 인자로 Error message를 적으면 해당 Error message가 출력되며 Error가 발생하고, 코드의 실행이 종료됩니다. raise TypeError("Only integer type is allowed.") 위처럼 raise로 발생시킬 Error의 type도 변경할 수 있습니다. 위 예시는 TypeError를 일으킵니다.
Python/Python Basic
2021. 6. 26. 18:16