notebook.community
Edit and run
In [1]: %timeit sum((int(c) for c in str(2 ** 1000))) sum((int(c) for c in str(2 ** 1000)))
%timeit sum((int(c) for c in str(2 ** 1000))) sum((int(c) for c in str(2 ** 1000)))
1000 loops, best of 3: 294 us per loop Out[1]: 1366
1000 loops, best of 3: 294 us per loop
1366