Hi I am a beginner and very new to python. I am just trying to understand how to print the total sum of numbers in a file.
I have used the code to just open and read the file,
f = open("example.txt") print(f.read())
but I was wondering if anyone knew a way to sum all the numbers within the file and print the end result (I am using python 2.7). Thank you for your time.