Apologies if this question has already been asked but I do not think I know the correct terminology to search for an appropriate solution through google.
I would like to
Try
dave = next(person for person in a.pList if person.num == 123)
or
for person in a.pList: if person.num == 123: break else: print "Not found." dave = person