On Feb 17, 2014 11:06 AM, "Gabriele Brambilla" < gb.gabrielebrambi...@gmail.com> wrote: > > Hi, > > I'm wondering how I can (if I can) make a for loop in which I don't use all the elements. > > for example > > a100 = list(range(100)) > > for a in a100: > print(a) > > it print out to me all the numbers from 0 to 99 > But if I want to display only the numbers 0, 9, 19, 29, 39, ...(one every 10 elements) how can I do it WITHOUT defining a new list (my real case is not so simple) and WITHOUT building a list of indexes? > > thank you > > Gabriele > > __________since this is homework, study if statements and the modulo operator (%)_____________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor