Skip to content

Instantly share code, notes, and snippets.

@carlosm27
Created November 23, 2022 17:26
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 carlosm27/4adfa994c7b39b4726d1ca152d210e48 to your computer and use it in GitHub Desktop.
Save carlosm27/4adfa994c7b39b4726d1ca152d210e48 to your computer and use it in GitHub Desktop.
get_item function
def get_item(id: int, db: list):
fruit = {}
for dic in db:
for val in dic.values():
if val == id:
fruit = dic
return fruit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment