95.2k views
1 vote
How to calculate absolute value in Python?

User TheZuck
by
7.3k points

1 Answer

4 votes
For integer numbers, the abs() function returns the absolute value of the given number. For floating point numbers, the abs() function returns the absolute value of the given number. For complex numbers, the abs() function returns the magnitude of the given number.
User Blissfool
by
7.5k points