본문 바로가기 메뉴 바로가기

Good Developer

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Good Developer

검색하기 폼
  • 분류 전체보기 (89)
    • Backend (59)
    • hhplus (6)
    • 개발서적 (5)
    • React (3)
    • Python (16)
    • 하코테 (0)
  • 방명록

zip (1)
[Python] zip() and enumerate()

zip(), enumerate()에 대해 간략하게 알아보도록 하겠습니다.내장 함수 zip()는 iterable 객체를 인자로 받아 각 객체가 가지고 있는 값을 튜플의 형태로 접근할 수 있는 iterator를 반환합니다. 1. 기본 문법은 아래 예제를 통해 확인해 보겠습니다.int_list = [1, 2, 3, 4]str_list = ['a', 'b', 'c', 'd']for i, s in zip(int_list, str_list): print(i, s)# 1 a# 2 b# 3 c# 4 dint_list = [1, 2, 3, 4]str_list = ['a', 'b', 'c', 'd']for i in zip(int_list, str_list): print(i)# (1, 'a')# (2, 'b')#..

Python 2023. 6. 3. 14:55
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • counter
  • find
  • operators
  • isalpha
  • isdigit
  • Lower
  • zip
  • function
  • Python
  • Method
  • Built-in Functions
  • for
  • bool
  • Lambda
  • index
  • combinations
  • Upper
  • If
  • permutations
more
«   2026/02   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바