How to generate exponentially increasing range in Python

前端 未结 8 1234
醉梦人生
醉梦人生 2020-12-15 23:05

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 1

8条回答
  •  情话喂你
    2020-12-15 23:37

    Why not

    for exponent in range(2, 10):
        test(10 ** exponent)
    

    if I'm reading your intent right.

提交回复
热议问题