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 | 29 | 30 | 31 |
Tags
- 그대로 출력하기
- plot in r
- 데이터분석
- await
- DataFrame
- 배열추가
- 10172
- getline
- 백준 10172
- 탈출문자
- R 그래프
- 배열삭제
- 이스케이프시퀀스
- 이용현황분석
- setstate
- 버스분석
- react #회원가입 #비밀번호비교
- 그래픽
- barplot
- vetor
- useState
- R데이터형태
- 백준 11718
- 광명시버스분석
- React
- barplot in r
- 백준
- 값추가
- asynchronization
- 값삭제
Archives
- Today
- Total
devlog_zz
[python] enumerate 함수 본문
728x90
enumerate() 함수는 기본적으로 인덱스와 원소로 이루어진 터플(tuple)을 만들어줍니다.
[ 기본 enumerate ]
for entry in enumerate(['Apple', 'Banana', 'Cherry']):
print(entry)
결과
(0, 'Apple')
(1, 'Banana')
(2, 'Cherry')
[ index, value 따로 접근 ]
for idx, value in enumerate(['Apple', 'Banana', 'Cherry']):
print(idx,value)
결과
0 Apple
1 Banana
2 Cherry
[ index를 특정 숫자부터 시작하기 ]
enumerate(arr,특정 숫자)
for idx, value in enumerate(['Apple', 'Banana', 'Cherry'],1):
print(idx,value)
결과
1 Apple
2 Banana
3 Cherry
728x90
'Back End > python' 카테고리의 다른 글
[python] Counter list 원소 개수 세기 (0) | 2022.08.07 |
---|---|
[python] set - list 중복 제거 (0) | 2022.08.07 |
[python] list 길이 (0) | 2022.08.07 |
[python] list의 특정 값의 위치 (0) | 2022.08.07 |
python 기초 문법 (0) | 2022.06.30 |
Comments