0 votes
in Python by
--> absolute value python

How to calculate absolute value in Python?

1 Answer

0 votes
by
How to calculate absolute value in Python?

PythonServer Side ProgrammingProgramming

The abs() function of Python's standard library returns the absolute value of the given number. Absolute value of a number is the value without considering its sign. Hence absolute of 10 is 10, -10 is also 10. If the number is a complex number, abs() returns its magnitude.

Example

>>> abs(11.11)

11.11

>>> abs(-11.11)

11.11

>>> abs(2+3j)

3.605551275463989

>>> abs(3-6j)

6.708203932499369

>>> abs(3-4j)

5.0

Related questions

0 votes
asked Aug 30, 2020 in Python by sharadyadav1986
0 votes
asked Aug 30, 2020 in Python by sharadyadav1986
...