2
Contributors
1
Reply
18
Views
3 Years
Discussion Span
Last Post by vegaseat
1

abs(x) where x is an argument for the function abs()

For example ...

x = -123
print(x)
print(abs(x))

From the manual ...
abs(x)
Return the absolute value of a number. The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned.

See also ...
https://www.daniweb.com/software-development/python/threads/20774/starting-python#post104853

Edited by vegaseat

Votes + Comments
Thank you very much
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.