新博客地址:http://gorthon.sinaapp.com/
Problem 48
The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
>>> str(sum([i**i for i in range(1,1001)]))[-10:]
'9110846700'
>>>
The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
>>> str(sum([i**i for i in range(1,1001)]))[-10:]
'9110846700'
>>>
1.while循環的格式 while 條件: 條件滿足時,做的事情1 條件滿足時,做的事情2 條件滿足時,做的事情3 ...(省略)... demo