Python functions-abs () from today on, I will update a python function every day, with notes for using instances and functions. I gave this function topic the name "python function one talk every day". I hope you can support it. Haha
Starting from below, today's function is abs ()
Read the official English document for explanation.
Abs (x)
Return the absolute value of a number. The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned.
Details:
Returns the absolute value.
The parameter can be a negative number, a positive number, a floating point number, or a long integer.
Instance:
Abs (-1.2) # returns 1.2 abs (1.2) # returns 1.2 abs (-11216.5) # returns 11216.5 abs (11216.5) # returns 11216.5 abs () # returns
Note: the parameter can be a negative number or a positive number. Only the absolute value is obtained, and no integer is obtained.