Skip to content

Instantly share code, notes, and snippets.

@Kalimaha
Last active October 14, 2017 00:25
Show Gist options
  • Select an option

  • Save Kalimaha/1baffd524519ec81617d580dc3a11e54 to your computer and use it in GitHub Desktop.

Select an option

Save Kalimaha/1baffd524519ec81617d580dc3a11e54 to your computer and use it in GitHub Desktop.
iterate key, value for each dict in a list
headers = [{'Content-Type': 'application/json'}, {'Accept', '*/*'}]
for key, value in sum(list(map(list, map(dict.items, headers))), []):
print(str(key) + ': ' + str(value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment