<div dir="ltr">Doesn't exist a way in Python to do like in C<div><br></div><div>for i=0, i<100, i=i+10</div><div><br></div><div>? without creating a list of index?</div><div><br></div><div>Gabriele</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-02-17 11:15 GMT-05:00 David Palao <span dir="ltr"><<a href="mailto:dpalao.python@gmail.com" target="_blank">dpalao.python@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Gabriele,<br>
Without knowing the details of what you are trying, I guess you could<br>
be interested in looking at how to define your own iterators.<br>
<br>
Regards<br>
<br>
2014-02-17 17:05 GMT+01:00 Gabriele Brambilla <<a href="mailto:gb.gabrielebrambilla@gmail.com">gb.gabrielebrambilla@gmail.com</a>>:<br>
<div><div class="h5">> Hi,<br>
><br>
> I'm wondering how I can (if I can) make a for loop in which I don't use all<br>
> the elements.<br>
><br>
> for example<br>
><br>
> a100 = list(range(100))<br>
><br>
> for a in a100:<br>
> print(a)<br>
><br>
> it print out to me all the numbers from 0 to 99<br>
> But if I want to display only the numbers 0, 9, 19, 29, 39, ...(one every 10<br>
> elements) how can I do it WITHOUT defining a new list (my real case is not<br>
> so simple) and WITHOUT building a list of indexes?<br>
><br>
> thank you<br>
><br>
> Gabriele<br>
><br>
</div></div>> _______________________________________________<br>
<div class="HOEnZb"><div class="h5">> Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
> To unsubscribe or change subscription options:<br>
> <a href="https://mail.python.org/mailman/listinfo/tutor" target="_blank">https://mail.python.org/mailman/listinfo/tutor</a><br>
><br>
</div></div></blockquote></div><br></div>