Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> listdict2dict={{names[k]:v for k,v in d.items()}}
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- TypeError: unhashable type: 'dict'
- >>>
- >>> listdict2dict={name[k]:v for k,v in d.items()}
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "<stdin>", line 1, in <dictcomp>
- NameError: global name 'name' is not defined
- >>> listdict2dict={names[k]:v for k,v in d.items()}
- >>> print listdist2dict
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- NameError: name 'listdist2dict' is not defined
- >>> print listdict2dict
- {'Larry': 1000.0, 'Moe': 990, 'Curly': 1200.5}
- >>> listdict2dict={names[k]:v for (k,v) in d.items()}
- >>> print listdict2dict
- {'Larry': 1000.0, 'Moe': 990, 'Curly': 1200.5}
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement