Question #174550

Write a program to print the absolute difference between the two given numbers. (Absolute difference is the difference without the negative sign)


Expert's answer

print ('Enter first number: ')
first = input()
print ('Enter second number: ')
second = input()
print ('Absolute difference is: ')
if (int(first) - int(second)) > 0:
    print(int(first)-int(second))
else:
    print(int(second) - int(first))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS