구조문

구조문 (Structured statements)

구조문은 더 작은 단순문들로 쪼갤 수 있어요. 반복·조건·순차적으로 실행되죠.

출처: 문서

본문

구조문(structured statement)은 더 작은 단순문으로 나눌 수 있으며, 그 단순문들은 반복·조건 또는 순차적으로 실행돼요.

구조문은 크게 조건문, 반복문, 그리고 그 외에 with 문과 예외 처리 문으로 나뉘어요.

structured statement ── conditional statement (조건문)
                    ├── repetitive statement (반복문)
                    ├── with statement
                    └── exception statement (예외 처리 문)

조건문 (conditional statement) 은 두 가지 종류가 있어요.

conditional statement ── case statement
                      └── if statement

반복문 (repetitive statement) 은 네 가지 종류가 있죠.

repetitive statement ── for statement
                    ├── for in statement
                    ├── repeat statement
                    └── while statement

다음 절들에서 이 각각의 문장을 하나씩 자세히 다룰게요.

더 알아보기