Python Training _ 24

WONY_yoon·2025년 10월 20일
post-thumbnail

Parallel Iteration

아래 3개의 리스트 를 {key : a , value : b * c} 형태의 Dict(딕셔너리) 구조로 변경

a = ["one", "two", "three", "four"]
b = [30, 20, 15, 75]
c = [5.2, 7.4, 3.6, 4.2]

출력 결과 : "{'one': 156.0, 'two': 148.0, 'three': 54.0, 'four': 315.0}"
# 다양한 Iterable 그룹을 묶어 연산하는 과정은 중요해요.
# zip : 다중 그룹의 반복가능한 자료형을 묶는 기능
# usage : zip(*iterables, strict=False) # Changed in version 3.10: Added the strict argument.
# python string package : https://www.oulub.com/en-US/Python/library.functions-zip

0개의 댓글