Python Program To Find Absolute Value Of Number

Write Python code to find absolute value of number

n = input("Enter the value :--> ")

absolute = abs(int(n))

print("\nThe absolute value of the number is :-->", absolute)

Output:

Run - 1:
Enter the value :--> 11

The absolute value of the number is :--> 11

Run - 2:

Enter the value :--> -11

The absolute value of the number is :--> 11

<< Previous | Next >>


Leave a Reply

Your email address will not be published.