Python Iterations

admin
By -
0

 









Dict Iterate Key and Value using zip() function

code:

#iterating over dict with both key and values through zip


d = {"a": 100, "b": 2, "c": 3}

 

for key,value in zip(d.keys(),d.values()):

     print(key,value)


#output:

a 100

b 2

c 3




Tags:

Post a Comment

0Comments

Please Select Embedded Mode To show the Comment System.*