#16: Power digit sum | Ben Cunningham

#16: Power digit sum

Problem by Project Euler · on May 3, 2002

and the sum of its digits is .

What is the sum of the digits of the number ?

Python

import functools
import operator

def v_sum(x):
    if len(x) < 1:
        return 0
    return functools.reduce(operator.add, x)

ans = v_sum([int(x) for x in list(str(2 ** 1000))])

print(ans)
## 1366