DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
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
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#convert
#negative
#positive
#python
ADD COMMENT
Topic
COMMENT
Name
3+3 =
Submit