#!/usr/local/bin/python2 l = range(10) n = 5 for i in xrange(100000): for j, f in enumerate(l): if j == n: r = f else: f print r