Skip to content
Advertisement

Search substring in list of dictionaries of namedtuples keyed with an event type

I have created a list of dictionaries of named tuples, keyed with an event type.

JavaScript

What would be the most pythonic method to return/print results that only contain “approved=1”, or “reviewed=1” and “approved=0”?

Advertisement

Answer

Not sure what output format you want exactly, but here’s a demo for approved == 1.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement