F Calculate Absolute Number using Python program | CodeTheta

Calculate Absolute Number using Python program

June 14, 2018

Code :
Number = int(input("Enter any positive or negative number: "))
if Number < 0:
    Number = (-1) * Number
    print ("Result is: ", Number)
else:
    print ("Result is: ", Number)

Output :
Enter any positive or negative number: -2458
Result is:  2458

IDE Used To Test This Code : Python IDLE.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.

Post a Comment