SyntaxFix
Write A Post
Hire A Developer
Questions
You can use a list comprehension:
def search(name, people): return [element for element in people if element['name'] == name]