After prompting a user to enter an integer and printing the absolute value of it, how do you convert a negative input integer into positive using if statements.
Asked
Active
Viewed 774 times
-5
-
`number *= -1 ` – Nordle Mar 13 '19 at 07:29
-
You can do this by writing `if number < 0: number *= -1` but that is the wrong way to do it. The correct way is just `number = abs(number)`. – BoarGules Mar 13 '19 at 07:35