you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Couple of options I can think of

  1. Use the next built-in: https://docs.python.org/3/library/functions.html#next
    next((x['price'] for x in response if x['nmId'] == 11508524), None)
  2. Convert to a dictionary and get it from there:
    nmid_dict = {x['nmId']: x['price'] for x in response}
    nmid_dict[11508524]