해바라기찬
python enumerate 본문
lst = [1,2,3,4,5]
for i in enumerate(t):
print(i)를 해보면
(0,1)
(1,2)
(2,3)
(3,4)
(4,5)
튜플형식으로 리턴 앞원소는 index 뒤원소는 index의 값
'python' 카테고리의 다른 글
python map함수 (0) | 2022.03.25 |
---|---|
list복사할때 주의점 (0) | 2022.03.17 |
python sorted (0) | 2022.01.26 |
python dictionary (0) | 2022.01.26 |
python zip (0) | 2022.01.25 |