Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
abs function in python 1

abs function in python

April 28, 2022 by Anurag batra
negative_number = -7
positive_number = abs(negative_number)

Here is what the above code is Doing:
1. We create a variable called negative_number and set it equal to -7.
2. We create a variable called positive_number and set it equal to the absolute value of negative_number.
3. We print positive_number.

Categories Python Examples
Post navigation
python version command notebook
numpy array remove scientific notation
© MyEduKit - 2022 . All Rights Reserved.