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
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
0Comments