Python Essentials: MUST knows about the zip() function! #python #programming

preview_player
Показать описание
Like and subscribe for more python and programming content!

Music details:
_______________________________________
Music track: Creamy by Aylex
Vlog Music for Videos (Free Download)
_______________________________________

#python #pythonforbeginners #pythonbasics #coding #programming #pythontutorial #pythonprogramming
Рекомендации по теме
Комментарии
Автор

Really good tips for beginners! Keep them coming

poorvaarora
Автор

There is also itertools.zip_longest(args*, fillvalue=None), which will always include all elements of all of the provided iterables. Any missing values get the fillvalue.

nigh_anxiety
Автор

Tip, make the editor's text bigger for mobile users. Lots of wasted space currently.

Eurotool
Автор

How often do you find yourself using the zip function!?

Also, something to note: the "strict" argument is only available in Python 3.10 onwards.

codeaffinitydev
Автор

Love this content and your video style! Can’t wait for more

luciejwang
Автор

Other output types:

l_Names = ["Jack", "Jill", "Steve"]
l_Ages = [61, 35, 42]

print( list(zip(l_Names, l_Ages)) ) # [('Jack', 61), ('Jill', 35), ('Steve', 42)]

print( [list(x) for x in zip(l_Names, l_Ages)] ) # [['Jack', 61], ['Jill', 35], ['Steve', 42]]
print( list(map(list, zip(l_Names, l_Ages))) ) # [['Jack', 61], ['Jill', 35], ['Steve', 42]]

print( dict((x, y) for x, y in zip(l_Names, l_Ages)) ) # {'Jack': 61, 'Jill': 35, 'Steve': 42}
print( dict(zip(l_Names, l_Ages)) ) # {'Jack': 61, 'Jill': 35, 'Steve': 42}

k.chriscaldwell
Автор

why not use a dict or a class in a list

lhcyt
Автор

Can u create a playlist for your videos?

MAShams
Автор

this guy sounds like a path of exile streamer

thrice
welcome to shbcf.ru