python for문

Published by onesixx on

for <원소> in <목록>:

Python은 for in 문만 있음.

<원소> loop variable. <목록>객체내에 원소들이 하나씩 할당
<목록> 거의 모든 타입 사용 . list, tuple, string, iterator, generator, range()와 len() 내장 함수

Python
Python

iterable

list

Python

range

Python

enumerate 내장 함수로 for 루프 돌리기

Python

인덱스 번호와 컬렉션의 원소를 tuple형태로 반환 (일일이 세다)

Python
Python
https://www.daleseo.com/python-enumerate/

중첩루프

Python

while

Python

for and if in one line

python-for문-if문-한-줄로-코딩하기

Python
Python
Python
Python
Python
Python
Python
Categories: Python Basic

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x