Answer to Question #231921 in Python for umesh

Question #231921

Finding Difference

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


The first line of the input will be an integer N1.

The second line of the input will be an integer N2.Output


Print the absolute difference of the given two numbers.Explanation


For example, if the given N1 is 200 and N2 is 500

The difference in number is 200 - 500 = -300

The absolute difference is 300.


1
Expert's answer
2021-09-01T07:54:22-0400
n1 = int(input('First integer: '))
n2 = int(input('Second integer: '))
print('Absolute difference: ', abs(n1 - n2))

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