Finden Sie das erste Ereignis von Gegenstand in einer Liste in Python

next(obj for obj in objs if obj.val == 5)
Anies