+ 1
What does abs() stand for in Python ?
Function of abs()
2 ответов
+ 4
abs() takes any number (positive/negative) and returns a positive number.
For example:
———————————
abs(-5)
>>>5
abs(-12.03)
>>>12.03
————————————
Hope this helps, procheta bhattacharyya 😊
+ 1
Copyright www.tutorialspoint.com
"Description
The abs() method returns the absolute value of x i.e. the positive distance between x and zero.
Syntax
Following is the syntax for abs() method −
abs( x ) "
In layman's terms, it will turn any number to a positive number, for example
print abs ( -5 ) will print out 5
2 - 10 = -8
-8 absolute = 8