To take a little further,and is better to use
with open()
then don't need to use close()
as it dos automatically.with open('col.txt') as f: next(f) for line in f: line = line.strip() num1, num2 = line.split(',') num1, num2 = int(num1), int(num2)So now is ready to continue further,if i do a test after running this code.
>>> num1 + num2 803As expected i get the last calculation.