Input:
691 41
947 779
Output:
1300
336
I have tried this solution a link
but my problem is end of last line is unknown
My Code:
for line in iter(input,"\n"):
a,b = line.split()
a = int(a)
b = int(b)
result = 2 * (a - b)
print(result)
My code is printing the desired output but the for loop is not terminating. I am a new bee to python is there any way to find the last input from the stdin console???