반응형
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 | 29 | 30 | 31 |
Tags
- Mac
- gas
- SQL
- PySpark
- django
- string
- PANDAS
- Google Excel
- matplotlib
- Kotlin
- google apps script
- Apache
- Java
- Excel
- numpy
- Github
- Redshift
- list
- GIT
- Tkinter
- 파이썬
- Google Spreadsheet
- hive
- math
- dataframe
- array
- Python
- PostgreSQL
- c#
Archives
- Today
- Total
목록finally (1)
달나라 노트
Python Basic : try ~ except ~ else ~ finally (Error 발생 상황 다루기)
Python에서는 try except 구문을 통해 Error가 발생했을 때 어떤 동작을 할지 설정할 수 있습니다. try syntax try: # 가장 먼저 실행할 code block except: # try block에서 Error발생 시 실행할 code block else: # try block에서 Error가 발생하지 않았을 때 실행할 code block finally: # try block에서 Error발생 여부에 상관없이 무조건 실행할 code block try ~ except 구문의 syntax는 위와 같습니다. 보면 Error가 발생할 때의 모든 경우를 다룰 수 있도록 되어있습니다. 필수 구문은 try ~ except이며 else와 finally는 적지 않아도 됩니다. try ~ except..
Python/Python Basic
2021. 6. 26. 18:26