variableName = -4
print(abs(variableName))
#output is 4
negative_number = -7
positive_number = abs(negative_number)
print ("abs(-45) : ", abs(-45))
print ("abs(100.12) : ", abs(100.12))
output:
45
100.12
Help on built-in function abs in module __builtin__:
abs(...)
abs(number) -> number
Return the absolute value of the argument.
sqrt(3^2 + 4^2) = sqrt(9 + 16) = sqrt(25) = 5