Your problem is here:
for Numbers in inFile3: Total = Total + int(Numbers)
Numbers in the above code is a list of strings, not a list of numbers.
for Line in inFile3: for number in Line.split(','): Total = Total + int(number)
should help.
You also do not need to pre-declare variables the way you are in Python. In fact, doing this with the global is positively dangerous if you do not know what you are doing and why.
Edit: If you ever have a comma at the end of a line, an empty value, you can change the final line to:
if number.strip(): Total = Total + int(number)
This ignores any "empty" strings of numbers that otherwise cause an error.
mavnn source share