#!/usr/local/bin/python2 l = range(50) for i in xrange(300000): r = reversed([e for e in l if e < 0]) next(r, None)