码迷,mamicode.com
首页 > 编程语言 > 详细

Euler Project question 16 in python way

时间:2014-10-21 23:07:02      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:io   os   ar   for   on   art   python   file   print   

# 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)

Euler Project question 16 in python way

标签:io   os   ar   for   on   art   python   file   print   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!