Complete worked example
python
def select_ids(rows, country):
return sorted(row["id"] for row in rows
if row["active"] and row["country"] == country)- Reasoning
- The expression filters with both conditions before sorting selected identities.