<commit_before>---
title: Python Abs Function
---
`abs()` is a built-in function in Python 3, to compute the absolute value of any number. The absolute value of a number "means only how far a number is from 0" <sup>1</sup> It takes one argument `x`. The argument can even be a <a href='https://docs.python.org/3.0/library/cmath.html' target='_blank' rel='nofollow'>complex number</a>, or a <a href='https://en.wikipedia.org/wiki/Expression_(mathematics)' target='_blank' rel='nofollow'>mathematical expression</a>. 

## Argument

It takes one argument `x` - either an integer, or decimal, or complex number, or any mathematical expression in general.
<commit_msg>fixed grammar/articulation of certain sentences (#30508)<commit_after>---
title: Python Abs Function
---

In Python 3,`abs()` is a built-in function that computes the absolute value of any number. The absolute value of a number "means only how far a number is from 0" <sup>1</sup> It takes one argument `x`, and the argument can even be a <a href='https://docs.python.org/3.0/library/cmath.html' target='_blank' rel='nofollow'>complex number</a>, in which case its <a href='http://www.mathcentre.ac.uk/resources/sigma%20complex%20number%20leaflets/sigma-complex9-2009-1.pdf' target='_blank' rel='nofollow'>modulus</a> is returned.

## Argument

It takes one argument `x` - either an integer, or decimal, or complex number, or any mathematical expression in general.

{'fraction_non_alphanumeric': 0.12666200139958012, 'fraction_numerical': 0.018894331700489854, 'mean_word_length': 4.7894736842105265, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6333695', 'n_tokens_mistral': 438, 'n_tokens_neox': 414, 'n_words': 168}