In python 3, how can we change a list of numbers (such as 4, 1, -7, 1, -3) and change all of the negative signs into positive signs?
Asked
Active
Viewed 8,546 times
-3
-
Python, like virtually all programming languages, has a built-in absolute value function. Just use it in a loop or a comprehension. – John Coleman Sep 14 '16 at 18:14
-
You would have found many results if you had googled "negative numbers to positive python" – Sterling Archer Sep 14 '16 at 18:18