Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created August 10, 2020 02:27
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 IndhumathyChelliah/c81aac0512bdcf20545de3cc7fb05e95 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/c81aac0512bdcf20545de3cc7fb05e95 to your computer and use it in GitHub Desktop.
l1=[{1:'a',2:'b'},{3:'c',4:'d'}]
d1={k:v for e in l1 for (k,v) in e.items()}
print (d1)
#Output:{1: 'a', 2: 'b', 3: 'c', 4: 'd'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment