I was wondering if there was a function built into Python that can determine the distance between two rational numbers but without me telling it which number is larger. e.g.
Just use abs(x - y). This'll return the net difference between the two as a positive value, regardless of which value is larger.
abs(x - y)