On 17 February 2014 16:17, Gabriele Brambilla <gb.gabrielebrambi...@gmail.com> wrote: > Doesn't exist a way in Python to do like in C > > for i=0, i<100, i=i+10 > > ? without creating a list of index?
You haven't said which Python version you're using. In Python 2 the range function returns a list but the xrange function returns an iterator. In Python 3 the range function returns an iterator. Assuming you're using Python 3 then you can just do: for i in range(0, 100, 10): print(a100[i]) Oscar _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor