How about: ----------- x = [0, 100, 200, 1000] y = -1 inserted = False
for i in range(len(x)): if(y <= x[i]): x.insert(i, y) inserted = True break if(not inserted): x.append(y) print x ------------ -- http://mail.python.org/mailman/listinfo/python-list