Answers for "function who change negative into positive in python"

4

convert negative to positive in python

>>> n = -42
>>> -n       # if you know n is negative
42
>>> abs(n)   # for any n
42
>>> abs(-5.05)
5.05
Posted by: Guest on October-27-2020

Code answers related to "function who change negative into positive in python"

Python Answers by Framework

Browse Popular Code Answers by Language