Subtract middle by youngest to find age difference then add it back to the middle value to find oldest
def ages(a,b):
d = b - a
if a == b:
print(a)
else:
print(b + d)
age1 = int(input())
age2 = int(input())
ages(age1,age2)
Comments