Copyright © tutorialspoint.com
This function returns absolute value of x - the (positive) distance between x and zero.
abs( x ) |
Here is the detail of parameters:
x: This is a numeric expression.
The absolute value of x.
#!/usr/bin/python print "abs(-45) : ", abs(-45) print "abs(100.12) : ", abs(100.12) print "abs(119L) : ", abs(119L) |
This will produce following result:
abs(-45) : 45 abs(100.12) : 100.12 abs(119L) : 119 |
Copyright © tutorialspoint.com