Posts by fboaventura • 111 points
1 post
-
1
votes4
answers241
viewsA: Filter list of python objects
The function filter() applies a function to an eternal object. In your case, we’d have something like this: def filtro(x): if x['ID'] == 1: return True else: return False lista = [{ ID: 1, Name:…