Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Python Number abs() Function
Description:
This function returns absolute value of x - the (positive) distance between x and zero.
Syntax:
Parameters:
Here is the detail of parameters:
Return Value:
The absolute value of x.
Example:
#!/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
|
|
|
|