Python Forum
Search a List of Dictionaries by Key-Value Pair; Return Dictionary/ies Containing KV
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search a List of Dictionaries by Key-Value Pair; Return Dictionary/ies Containing KV
#11
please, both of you, note that

if market['IsActive'] == True  and  market['IsRestricted'] == False:
is better as
if market['IsActive'] and not market['IsRestricted']:
market['IsActive'] and market['IsRestricted'] are booleans, use it
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Search a List of Dictionaries by Key-Value Pair; Return Dictionary/ies Containing KV - by buran - May-28-2019, 01:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sort a list of dictionaries by the only dictionary key Calab 2 648 Apr-29-2024, 04:38 PM
Last Post: Calab
  How do I calculate a ratio from 2 numbers and return an equivalent list of about 1000 Pleiades 8 15,812 Jan-05-2024, 08:30 PM
Last Post: sgrey
  Dictionary in a list bashage 2 607 Dec-27-2023, 04:04 PM
Last Post: deanhystad
  filtering a list of dictionary as per given criteria jss 5 756 Dec-23-2023, 08:47 AM
Last Post: Gribouillis
  Search Excel File with a list of values huzzug 4 1,306 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Access list of dictionaries britesc 4 1,117 Jul-26-2023, 05:00 AM
Last Post: Pedroski55
  How to add list to dictionary? Kull_Khan 3 1,054 Apr-04-2023, 08:35 AM
Last Post: ClaytonMorrison
  search a list or tuple for a specific type ot class Skaperen 8 1,993 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  check if element is in a list in a dictionary value ambrozote 4 2,044 May-11-2022, 06:05 PM
Last Post: deanhystad
  Dictionary from a list failed, help needed leoahum 7 2,053 Apr-28-2022, 06:59 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020