Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
description:
Python abs () returns the absolute value of the function number for
grammar:
abs(x)
Parameter Description:
x --- numerical expressions. Parameter can be integer or floating point. If the argument is complex, and its size is returned. If x is defined abs, abs (x) returns x.
return value:
Returns the absolute value of number.
The following example shows ABS () function to use
print(abs(-48))
print(abs(48))
print(abs(-100.1))
print(abs(7+5J)) #复数,返回其大小
Export
48
48
100.1
8.602325267042627
This issue abs () function will learn here.