mirror of
https://github.com/correl/euler.git
synced 2024-11-27 19:19:50 +00:00
12 lines
219 B
Python
12 lines
219 B
Python
|
def powerseries(n):
|
||
|
i = 1
|
||
|
total = 0
|
||
|
while i <= n:
|
||
|
total = total + i**i
|
||
|
i = i + 1
|
||
|
return total
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
val = str(powerseries(1000))
|
||
|
print 'Last 10:', val[-10:]
|