Skip to content

Instantly share code, notes, and snippets.

@rajaramanathan
Created January 10, 2015 21:41
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 rajaramanathan/a4e1b5b3531fd2b2cfab to your computer and use it in GitHub Desktop.
Save rajaramanathan/a4e1b5b3531fd2b2cfab to your computer and use it in GitHub Desktop.
cols = [‘City’,’Country’,’ZipCode’]
values = [‘Paris’,’France’,’12345-12′]
zipped = zip(cols ,values)
print zipped #prints [(‘City’, ‘Paris’), (‘Country’, ‘France’), (‘ZipCode’, ‘12345-12′)]
dictionary = dict(zipped) #now just convert the zipped to a dictionary
print dictionary #prints {‘City': ‘Paris’, ‘ZipCode': ‘12345-12′, ‘Country': ‘France’}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment