I understand how to do this:
but messing around with this I foundCode:>>> p = [1, 2, 3] >>> q = ['a', 'b', 'c'] >>> d = dict(zip(p, q))
doesn't work. It creates an empty dict. Could anyone explain why this is, it feels like I have missed something important.Code:>>> p = [1, 2, 3] >>> q = ['a', 'b', 'c'] >>> z = zip(p, q) >>> d = dict(z)
Python 3.3