keys = ['a', 'b', 'c', 'd']
values = range(4) # = [0, 1, 2, 3]
d = dict(zip(keys, values))
print(d)
|
{'a': 0, 'b': 1, 'c': 2, 'd': 3} |
'data science > python' 카테고리의 다른 글
lambda, map, filter, reduce (0) | 2025.01.25 |
---|---|
if else 를 간단히 (tenary operator) (0) | 2025.01.24 |
Redis Pub/Sub (1) | 2024.09.09 |
Thread vs ThreadPool vs ThreadPoolExecutor (0) | 2024.05.11 |
threading / multiprocessing / asyncio (0) | 2024.05.02 |