Skip to content

Instantly share code, notes, and snippets.

@spidaman
Created February 16, 2013 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spidaman/4968669 to your computer and use it in GitHub Desktop.
Save spidaman/4968669 to your computer and use it in GitHub Desktop.
python dictionary from a pair of lists
import json
links = ['link1', 'link2','link3']
images = ['img1','img2','img3']
json.dumps(dict(zip(links,images)))
# '{"link1": "img1", "link3": "img3", "link2": "img2"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment