Problem 13: http://projecteuler.net/problem=13
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. So, is the question sum the 5000 digits and the answer is the first 10 digits in the result?
bignumber = list of the 5000 digits
sum(bignumber) = abcdefghijklmnopqrst...
answer = abcdefghj
Well when I do this sum(bignumber) = 22660
(which even is not 10 digits)...
have I misread the question?
def foo():
with open ("bignumber", "r") as myfile:
data=myfile.read().replace('\n', '')
data = map(long, data)
datasum = sum(data)
return (datasum)