[Python] pass vs continue vs break
파이썬 알고리즘 문제를 풀던 중 이중 반복문을 탈출하는 방법을 구글링하다 error를 발생시켜 탈출하는 방법을 알게 됐고, 예시에서 pass를 알게 됐다. 다음은 해당 예시다. class LoopBreak(Exception): pass try: for i in range(5): for j in range(5): if i == 1 and j == 1: raise LoopBreak() except LoopBreak: pass W3Schools에 따르면 pass의 정의는 다음과 같다. pass : The pass statement is used as a placeholder for future code. When the pass statement is executed, nothing happens, but y..
기술(Tech, IT)/파이썬(Python)
2022. 9. 8. 02:21
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- java
- min heap
- C++
- 소켓 프로그래밍
- 티스토리챌린지
- ml
- Hash Map
- tf-idf
- 오블완
- DICTIONARY
- 투 포인터
- 파이썬
- 이코노미스트 에스프레소
- leetcode
- 리트코드
- Python
- Computer Graphics
- vertex shader
- The Economist
- 안드로이드
- machine learning
- 머신 러닝
- The Economist Espresso
- join
- socket programming
- Android
- I2C
- 이코노미스트
- defaultdict
- 딕셔너리
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함
반응형
