-
break, continuePython 2023. 9. 27. 14:11
break
break에는 :(콜론)을 붙이지 않음
continue
for, while의 반복할 코드에서 아무 일도 하지 않지만, 반복문의 형태를 유지하고 싶다면 pass
짝수를 출력하기 위해 continue 전에 print 입력했지만 보통은 continue 전 코드 비워 둠
중첩 루프 사용
콘솔에서 문자 출력을 하지 않으면 다음 문자는 현재 위치 출력, 모두 왼쪽으로 몰리게 됨
별을 출력하지 않는 부분에서는 print로 공백 출력 > 대각선 출력
'Python' 카테고리의 다른 글
리스트와 튜플 응용 (0) 2023.10.04 FizzBuzz와 터틀 그래픽스 (0) 2023.09.27 딕셔너리, if 조건문 (0) 2023.09.25 시퀀스 자료형 확인하기 (0) 2023.09.25 리스트와 튜플 (0) 2023.09.20