Skip to content

Instantly share code, notes, and snippets.

@ansig
Last active January 30, 2016 06:36
Show Gist options
  • Save ansig/7ce23ff77a259a12951c to your computer and use it in GitHub Desktop.
Save ansig/7ce23ff77a259a12951c to your computer and use it in GitHub Desktop.
Create a dict from two lists with items from second list under a subtitle
list1 = ['item1', 'item2', 'item3']
list2 = ['subitem1', 'subitem2', 'subitem3']
mapped_dict = {x: {"subtitle" :y} for x, y in zip(list1, list2)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment