abs()

Built-in FunctionPython 2.0+Beginner

Returns the absolute value of a number

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
print(abs(-42))
print(abs(3.14))
print(abs(-3 + 4j))

abs() is a built-in function that returns the absolute value of a number.

Try in Playground

Tags

builtinfunctioncoremathnumeric

Related Items