No, you can just use min
for parsing:
if min(ycoords[0],ycoords[1],ycoords[2]) > 0: # do stuff
and given that ycoords
has exactly three elements, even shorter:
if min(*ycoords) > 0:
you can here, as @Tagc says, omit the asterisk ( *
):
if min(ycoords) > 0:
but this will lead to some overhead.
Another option is to use all
:
if all(x > 0 for x in [ycoords[0],ycoords[1],ycoords[2]]):
or again if ycoords
contains only these three elements:
if all(x > 0 for x in ycoords):
source share