Project Euler #56: Powerful digit sum

  • + 1 comment

    There are quite a few things that can be improved for the performance obcessed:

    • a**b is much faster than pow(a, b). Try it with timeit.
    • You could iterate as: for k in p: q += int(k).
    • You could use tuple() instead of list(). Faster most of the times.

    Just a few thoughts.

    • + 0 comments

      Are you sure that a* * b is faster than pow(a,b)?