How to generate exponentially increasing range in Python
<p>I want to test the performance of some code using an exponentially increasing value.  So that as an extra digit is added to the numbers_size the increment is multiplied by 10.  This is how I'm doing it so far but it looks a bit hacky.  Suggestions for improvements without introducing non-standard libraries?</p>

<pre><code>numbers_size = 100
increment = 100
numbers_range = 1000000000
while numbers_size &lt; numbers_range:
    t = time.time()
    test( numbers_size )
    taken_t = time.time() - t
    print numbers_size, test, taken_t

    increment = 10 ** (len(str(numbers_size))-1)
    numbers_size += increment
</code></pre>
