for n in range(0, len(sign_slope)): if sign_slope[n] < 0 and sign_slope[n - 1] > 0: print sign_slope[n - 1] else: print 0