loop

Chris Angelico rosuav at gmail.com
Mon Mar 24 01:52:11 CET 2014


On Mon, Mar 24, 2014 at 11:35 AM,  <pabloeruggeri at gmail.com> wrote:
> Hello,
>
> I'm trying to create a for loop that starts at 100 and goes to 10Mllion. The increments are like this: 100, 1000, 10000, ..... Basicaly adding a zero each iteration. I'm having problems trying to do it. Can somebody help me
>

That sounds like a logarithmic scale. Look at this:

>>> 10**2
100
>>> 10**3
1000
...
>>> 10**7
10000000

Do you know how to iterate from 2 to 7 inclusive?

ChrisA



More information about the Python-list mailing list