3 ms·
sum(range(1, 100000001)) took ~3.25 seconds on my air under python3.
by surfearth 13y ago
sum(range(1, 100000001)) took ~3.25 seconds on my air under python3.
- gshubert17 13y agoYour number appears to be a factor of 10 smaller than the "one billion plus one" of the original. I get similar times on my Mac; about 3.2 seconds for 108 and 31.4 seconds for 109. Both are about 5 times faster than Python 2.7 for me.