I have a question about writing a Python program to have the sum of 2 numbers from a txt file. (This question was from the Australian Informatics Olympiad Training Website)
The Input File is: addin.txt and the Output File is: addout.txt
Input: The input file will consist of the two integers a and b separated by a single space. It is guaranteed that 0 <= a, b <= 1,000,000,000.
Output: The output file should consist of a single integer, the sum of a and b.
Sample Input: 23 45 Sample Output: 68
So far, I know how to read and write from txt files but I don't know how it would read the two numbers in the input separately.
Is it possible anyone could show me a program that would fit with this criteria? (Preferable with comments so I can understand it)
Thanks in advance for anyone's help!