Answer to Question #174550 in Python for Bhuvanesh

Question #174550

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


1
Expert's answer
2021-03-27T04:06:36-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS