def fn(x): while True: print x x = x + 1 #if x > 900: # break print 'Done' fn(1)