Sum

Report a typo

You have the file sums.txt. It has several lines, each of them containing two positive numbers separated by a whitespace.

For example:

9 61
15 47
2 1

Your program should read this file and print the sum of numbers on each line. So, if the file has n lines, you should print n sums, each on a separate line.

Don't forget to close the file!

Since lines are processed as strings, use str.split() to get two numbers. Just don't forget to convert them to int.
Write a program in Python 3
# read sums.txt
___

Create a free account to access the full topic