I have a list with these values.
lst1 = [1,-2,-4,-8,-9,-12,0,39,12,-3,-7]
I need to get the maximum value that is less than zero.
If I do print max(last) - I get 39, and the need is -2.
print max(p < 0 for p in lst1) , I get True, not -2
source share