Use the abs() function

#with integers
print(abs(-10))
#with floating point values
print(abs(2.5))
#with complex numbers
print(abs(4 + 3j))

The builtin abs() function returns the absolute value of a number. 

The function takes only one argument i.e the number which we want to get the absolute value of.

Syntax:

abs(num)

It supports all the numerical data types such as integers, floats and complex numbers.  For integers and the floating point numbers; the absolute value is the distance between that number and zero on a number line. It is the magnitude or size of the number without regard to its sign.

The absolute value of a positive number is the number itself while the absolute value of a negative number is its positive counterpart. For example, the absolute value of 3 is 3, and the absolute value of -3 is also 3.

Examples:

abs(6)
//6
abs(-7)
//7
abs(3.5)
//3.5
abs(-9.1)
//9.1
abs(-0.01)
//0.01

For complex numbers;  the absolute value is the distance from the origin (0,0) to the point (a,b) in the complex plane. This value is calculated using the Pythagorean theorem, for example the absolute value of 3 + 4j is 5.

The function returns a float value. Examples:

abs(3 + 4j)
//5.0
abs(-6 + 8j)
//10.0
abs(12 +9j)
//15.0
abs(7 + 6j)
//9.219544457292887
abs(-5 + 5j)
//7.0710678118654755