본문 바로가기

Today I Learned

검색하기
Today I Learned
프로필사진 떡볶이떡의 춤사위

  • 분류 전체보기 (17)
    • Java (6)
    • Spring (1)
      • Exception (1)
    • Algorithm (7)
    • Computer Science (2)
    • Python (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/12   »
일 월 화 수 목 금 토
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
  • 투 포인터
  • 플로이드
  • continue
  • 유니온파인드
  • for-else
  • garbage collection
  • 16562
  • 친구비
  • 정렬
  • 전구와 스위치
  • sop
  • Preflight
  • CORS
  • gc
  • BFS
  • 2138
  • 딕셔너리
  • python
  • Simple Request
  • 9205
  • 쿠키
  • 10159
  • Interface
  • 백준
  • 세션
  • java
  • 이분탐색
  • JVM
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Python (1)

Today I Learned

for-else

flag = True for i in range(5): if ooo:# 조건 flag = False break if flag: print("flag is true") else: print("flag is false") for i in range(5): if ooo:# 조건 break else: print("flag is true")# for loop이 정상적으로 다 돈 경우 실행된다. print("flag is false")# for loop에서 break가 실행되면 else 구문이 실행되지 않고 그 다음부터 실행된다. 위 두 코드는 같은 출력을 반환한다.

Python 2023. 5. 14. 16:01
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바