The zip() function returns an iterator of tuples based on the iterable objects. If a single iterable is passed, zip() returns an iterator of tuples with each tuple having only one element. If multiple iterables are passed, zip() returns an iterator of tuples with each tuple having elements from all the iterables.
Code:
names=('Kevin','Peter','Thomas','Tom','Peter')
comps=('Dell','Apple','Sony','Microsoft','Apple')
zipped=list(zip(names,comps))
print(zipped,'\n')
zipped=set(zip(names,comps))
print(zipped,'\n')
zipped=zip(names,comps)
for (a,b) in zipped:
print(a,b,'\n')
На этой странице сайта вы можете посмотреть видео онлайн 28. Zip Function in Python Example || Mapping Elements Python Programming Tutorial длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Ram Case 05 Июль 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 5 раз и оно понравилось 0 зрителям. Приятного просмотра!