If I understand correctly it can be done with for-loop:
lst = [0, -2, -5, 6, 8] def my_func(num): return num for item in lst: x = my_func(item) if x > 0: breakOf course one can have onliner fun as well:
next((item for item in lst if my_func(item) > 0))
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.