I have this iteration count using iter tools:
for i in itertools.count(start=2**68):
And I want it to bump up an exponent every time (68,69,70,71,…). Is there support for this in itertools? I have looked at the step option on the itertools documentation, but don’t see any way to change by exponential type only float, integer.
>Solution :
There is not a function specially made for that, but it’s very easy to make what you want from basic components:
for i in map(lambda i: 2**i, itertools.count(start=68)):
Incidentally, one of the comments says map(lambda...) is an antipattern, and should instead be replaced with generator expressions. Here is how to do in case you wonder.
for i in (2**i for i in itertools.count(start=68)):