Find the first occurrence in a list
for r in restaurants: if r.score >= 4.5: return r.name return "let's cook!" first = next((r.name for r in restaurants if r.score > 4.5), "let's cook!")