Copyright © tutorialspoint.com

# Python Number abs() Function

## Description:

This function returns absolute value of x - the (positive) distance between x and zero.

## Syntax:

    abs( x )

## Parameters:

Here is the detail of parameters:

- x: This is a numeric expression.

## 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

Copyright © tutorialspoint.com