May-03-2019, 02:16 PM
(This post was last modified: May-03-2019, 02:16 PM by python_user_n.)
Hello,
I'm testing this snippet of code:
I want to know if it's a normal behavior or my poor understanding of the language specifications.
Thanks.
I'm testing this snippet of code:
ld = [1, 2, 3] ll = ['a', 'b', 'c'] loft = zip(ll, ld) #for i in loft: # print(i) print(loft) d = dict(loft) print(d)If I uncomment the for loop the dictionary will be empty. I suppose for some reason loft reinitialize itself as empty variable.
I want to know if it's a normal behavior or my poor understanding of the language specifications.
Thanks.