Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
학습 내용 요약
if/elif/else)와 반복문(for/while)의 기본 사용법을 학습했다.range(),break,continue, 루프else절 등 제어 흐름 도구들을 정리했다.match문(Python 3.10+)을 활용한 패턴 매칭 구문을 학습했다.핵심 개념
for문은 C와 달리 시퀀스의 항목 자체를 순회하며, 이터레이션 중 컬렉션 수정은 금지해야 한다.range()는 리스트가 아닌 이터러블 객체를 반환하여 메모리를 절약한다.else절은break없이 정상 종료되었을 때만 실행된다.None을 사용해야 한다./,*)로 위치 전용, 키워드 전용 인자를 구분할 수 있다.실습 예제
examples/04_1_if.py: if/elif/else 조건 분기examples/04_2_for.py: for 순회, 컬렉션 수정 전략 (사본 이터레이트, 새 컬렉션 생성)examples/04_3_range.py: range(), enumerate(), sum() 활용examples/04_4_break_continue.py: break로 소인수 찾기, continue로 짝홀수 구분examples/04_5_loop_else.py: 루프 else절을 활용한 소수 판별examples/04_6_pass.py: pass문과 Ellipsis 플레이스홀더examples/04_7_match.py: match/case 패턴 매칭examples/04_8_function.py: 함수 정의, 기본값 주의, 람다, 언패킹, 어노테이션참고 자료
체크리스트