Skip to content

Instantly share code, notes, and snippets.

@includeamin
Created June 18, 2019 11:46
Show Gist options
  • Save includeamin/b0f6d3ba620eabdb67623726cefd9e7c to your computer and use it in GitHub Desktop.
Save includeamin/b0f6d3ba620eabdb67623726cefd9e7c to your computer and use it in GitHub Desktop.
Search in list of dictionary
data = [{"id":2,"f":3},
{"id":3,'f':4}]
a = next(item for item in data if item["id"]==2)
print a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment