Euler Project question 16 in python way

# This Python file uses the following encoding: utf-8
# 215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.

# What is the sum of the digits of the number 21000?
import time
start = time.time()
print "2**1000's sum of digits is %s and cost %s seconds" % (sum([int(i) for i in str(2**1000)]), time.time() - start)

原文地址:https://www.cnblogs.com/cyberpaz/p/4041726.html