Project Euler

Problem 16: Power digit sum

What is the sum of the digits of the number 2**1000? Run this solution at repl.io here.

      
        k = 2**1000
        k = str(k)
        answer = 0
        for x in k:
          answer += int(x)
        print(answer)
      
    

back to code menu