I have the following filter in my code:
id = 4
for result in filter(lambda list: list['id'] == id, list):
pass #do something with the result
List is a list of dictionaries. It may be that there are duplicates in the list. How can I limit the number of results to 1?