How to turn any negative number into a positive in Python

Posted on: January 21st, 2023
By: Tadeo Martinez

Use the abs() built-in function in Python.

number = -1

# Output
# 1

Have any questions or comments? Write them below!

Leave a Reply

Your email address will not be published. Required fields are marked *