Python | Combine Two Lists into a Dictionary | Zip Function

preview_player
Показать описание
If you have two lists and you want one lists' items to be the key in a dictionary and the other ones corresponding items to be the value in that dictionary you can solve this problem with the zip function
Рекомендации по теме
Комментарии
Автор

Hi my friend❤ I enjoyed 💫😍 Full support you as always🌟Thanks for sharing💕

PAPET
Автор

nice! didn't know this method existed. i've been combining lists into dictionaries the hard way this whole time lol

jakobball
Автор

This was so helpful. Watched several videos on it and did not get it your one minute video did the trick :)

SamyLovesSam
Автор

2 ways to do that:
my_dict = dict(list(zip(a, b)))
# or:
my_dict = {x: y for x, y in zip(a, b)}

shner
Автор

Can you please talk about how to work with text in Python.

Tritoon
Автор

How can I populate a csv file in a loop without overwriting it? I want to place each vector in a single row on each iteration. But my solution overwrites and creates a new csv each iteration in python
Can u help me in this??

vminkookie