hello,
i have to create a program that open a file, read the file, add the number form the files, and display the total sum.
Here is what i have
numbersFile = open('numbers.dat', 'r')
line = numbersFile.read()
for line in open("numbers.dat"):
nums = [int(x) for x in line.split()]
#close file
numbersFile.close()
print nums
the number inside the file ( numbers.dat ) are 13, 15, 19, some how they are not adding up
thanks for the help guys