python zip function tutorial example explained
#python #zip #function
zip(*iterables) = aggregate elements from two or more iterables (list, tuples, sets, etc.)
creates a zip object with paired elements stored in tuples for each element
usernames = ["Dude", "Bro", "Mister"]
passwords = ("p@ssword", "abc123", "guest")
login_dates = ["1/1/2021","1/2/2021","1/3/2021"]
--------------------------------------
users = list(zip(usernames,passwords))
for i in users:
print(i)
--------------------------------------
users = dict(zip(usernames,passwords))
for key,value in users.items():
print(key+" : "+value)
--------------------------------------
users = zip(usernames,passwords,login_dates)
for i in users:
print(i)
--------------------------------------
On this page of the site you can watch the video online Python zip function 🤐 with a duration of hours minute second in good quality, which was uploaded by the user Bro Code 25 January 2021, share the link with friends and acquaintances, this video has already been watched 17,223 times on youtube and it was liked by 906 viewers. Enjoy your viewing!