본문 바로가기
목차
Pages

[Python] Control Structure and Control Flow

by ds31x 2023. 10. 6.
728x90
반응형

Control structure와 Control Flow란 무엇인가?

2025.04.23 - [Python] - [Programming] Control Flow 와 Control Structure

 

[Programming] Control Flow 와 Control Structure

Abstraction(추상화)을 통한 이해프로그래밍 언어에서 Abstraction은 복잡한 세부 사항을 숨기고 핵심 개념만 드러내는 프로그래밍의 기본 원칙임. Control Flow와 Control Structure는 프로그램의 Execution Path

ds31x.tistory.com

이들은 대부분 compound statement로 구성됨

2025.07.27 - [Python] - Compound Statement란?

 

Compound Statement란?

Compound Statment란?Compound Statement is a statement that uses a colon :to sperate a header (head) from its body (=suite라고도 불림),which consists of eithera single simple statement on the same line oran indented code block of one or more statement

ds31x.tistory.com


조건 분기

if, elif, else

2023.07.28 - [Python] - [Python] Boolean Operators, Relational Operators, and Membership Operator

 

[Python] Boolean Operators, Relational Operators, and Membership Operator

Boolean Operators기본 boolean operator는 다음 3가지로 구성됨.and : and 연산자. (binary op.) : C언어 등에선 &&에 해당.or : or 연산자. (binary op.) : || 에 해당.not : not 연산자. (unary operator로 operand가 하나임.) : !에

ds31x.tistory.com

 

2023.07.28 - [Python] - [Python] if, elif, else statements

 

[Python] if, elif, else statements

if, elif, else statements (조건분기문)프로그램의 flow control를 담당함. (loop문과 함께)더보기Flow control을 위한 Control Structures에 대한 내용은 다음 URL을 참고.2025.04.23 - [Python] - [Programming] Control Flow 와 Cont

ds31x.tistory.com

 

match/case (3.10+)

2025.08.11 - [Python] - match statement-Structural Pattern Matching-match/case

 

match statement-Structural Pattern Matching-match/case

Python match/case Tutorial — 구조적 패턴 매칭1. match/casematch case는 Python 3.10에 도입된 구조적 패턴 매칭(Structural Pattern Matching) 기능임.단순 값 비교뿐 아니라, 자료구조의 모양(구조)을 분해하여 조건

ds31x.tistory.com

 


반복문

while

2023.07.28 - [Python] - [Python] while statement, break and continue

 

[Python] while statement, break and continue

Python의 경우, loop structure로 while statement와 for statement를 제공한다.Contol Flow와 Control Structure에 대한 개념은 다음 URL을 참고 :http://ds31x.blogspot.com/2023/07/basic-control-structures-and-control.html참고로 do-while st

ds31x.tistory.com


for

https://dsaint31.tistory.com/573

 

[Python] for statement

for statement는 loop를 위한 control structure의 대표격이다.더보기https://ds31x.blogspot.com/2023/07/basic-control-structures-and-control.html Basic : Control Structures and Control FlowControl Structure 프로그램을 구성하는 statement

dsaint31.tistory.com


else (break checker)

2023.09.18 - [Python] - [Python] else : break checker

 

[Python] else: break checker

반복문에서 else는loop 가 break로 끝나지 않을 경우 수행되는 code block을 지정.조건문에서 else일반적으로 else의 경우, 앞서의 if 와 elif문들에서 실행된 block이 없는 경우 수행되는 것을 의미한다.2023.

ds31x.tistory.com


관련 classes

https://dsaint31.tistory.com/502

 

[Python] range and enumerate

range 란엄밀하게 애기하면, range 는 숫자들의 immutable sequence 를 생성하기 위한Lazy Iterable (메모리 효율적인)을 나타내는 built-in type이다. 즉, 흔히 built-in function으로 애기하는 range() 는 사실은 range cl

dsaint31.tistory.com

 

https://dsaint31.tistory.com/501

 

[Python] Iterable and Iterator, plus Generator

Iterable and Iteartor, and GeneratorIterable for 문에서 in 뒤에 위치하여 iterate (반복, 순회)가 가능한 object를 가르킴.__iter__() 라는 special method를 구현하고 있으며, 이를 통해 자신에 대한 iterator object를 반환

dsaint31.tistory.com

 

 

728x90

'Pages' 카테고리의 다른 글

[Python] String : 문자열  (1) 2023.10.06
[Python] function 과 Scope, Name Space 정리 - Summary  (0) 2023.10.06
[Python] Collections  (0) 2023.10.06
Shell 관련 정리  (0) 2023.10.02