create dict from two lists python without zip()? -


i'm creating dict using zip(), how without zipping or numpy?

def listtodict(list1, list2): d={} return dict(zip(list1, list2))   print listtodict([1,2,3,4,5],['a','b','c','d','e']) 

just fun...

def listtodict(list1, list2):     return dict(max(vars(__builtins__).items())[1](list1, list2)) 

Comments

Popular posts from this blog

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -