Q11Numerical3 Marks1 Sep 2024
Consider the following snippet of code. What will be the output of the snippet of code?
Code Snippet
```
def filter(people, age, city):
people_list = []
for person in people:
if person["age"] >= age and person["city"] == city:
people_list.append(person)
return people_list
people = [
{"name": "Alice", "age": 25, "city": "New York"},
{"name": "Bob", "age": 30, "city": "Los Angeles"},
{"name": "Charlie", "age": 20, "city": "Chicago"},
{"name": "David", "age": 35, "city": "New York"},
{"name": "Elsie", "age": 31, "city": "New York"}
]
print(len(filter(people, 30, "New York")))
```
Press Enter to check.