Glossary
Abs (Absolute Value)
Calculate absolute values in Python
Python Abs (or absolute number) will return the absolute distance a number is away from 0. This simply means, how far away is it from 0?
For example, if you were to take a look at a number line, the number 4 is 4 spots away from 0. The number -3 (on the left of the number line) is 3 spots away from zero. 4 and 3 in this case are the absolute values.
Sometimes this is referred to at the βmagnitudeβ of your number.
This is an extremely common statical function that youβll see throughout the rest of your life.
Letβs take a look at a python abs code sample