Python Programs

Convert Negative Number To Positive In Python

Convert Negative Number To Positive In Python

Looking for a tutorial on how to convert negative number to positive in python then you are at the right place, Today in this article I will show you how to convert negative number to positive using python programming.

To convert negative number to positive we will use the python function called abs() it returns the absolute value of a number it is a built in function so let’s see how to use it.

Python Code To Convert Negative Number To Positive

negative_num = 1

Above is the python code to convert negative integer to positive. You can run this code and see the result. To run this program you need to have python installed, if you don’t have, then read this: Install and setup python.

Follow this steps to run this program:

  • First, create a new folder for this program.
  • Open it in a code editor of your choice.
  • Create a python file with .py extension.
  • Copy the above code and paste it in your file.
  • Open a terminal or CMD at folder location
  • And type this command python filename.py (Name of your py file).

After running the program you will see that it printed a positive number. Want to know how to convert positive number to negative then read hear: Convert positive number to negative in python.


This was the tutorial on converting negative integer to positive in python. I hope you found this tutorial helpful and useful. Do share this tutorial with your friends who might need this or find it helpful.

Here are some more python programs you will find helpful:

I hope you found what you were looking for from this python tutorial, and if you want more python tutorials like this, do join our Telegram channel to get updated.

Thanks for reading, have a nice day 🙂