Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- MacOS
- Algorithm
- MIPS
- XML
- CSS
- computer
- github
- DB
- data structure
- Pipelining
- php
- Linux
- for
- while
- Class
- javascript
- Java
- architecture
- html
- DS
- mysql
- web
- instruction
- DATAPATH
- DoM
- python
- control
- react
- system
- function
Archives
- Today
- Total
YYYEJI
[Python] Enumerate 함수 본문
728x90
Enumerate 함수란 ?
for문을 이용해서 list 안에 있는 값들을 하나씩 출력할 때 index를 앞에 같이 출력해주는 함수입니다.
아래 예제를 살펴보면 list 안에 값들이 하나씩 출력될 때 앞에 번호가 같이 출력되는 것을 확인할 수 있습니다.
abc = ["a", "b", "c", "d"]
for index, alpha in enumerate(abc):
print(index, alpha)
◡̈
'Python' 카테고리의 다른 글
[MacOS] FileNotFoundError: [Errno 2] No such file or directory: 'xxxx.txt' (0) | 2022.09.28 |
---|---|
[Python] find, startswith, endswith 함수 (0) | 2022.09.26 |
[Python] for문을 이용한 list 값 출력 (0) | 2022.09.26 |
[Python] Continue, Break (0) | 2022.09.26 |
[Python] 반복문 (for문) (0) | 2022.09.26 |