A pair can carry ordered input as well as a result. Choose names when unpacking so the calculations read like the problem.
def high_low(first, second):
return (max(first, second), min(first, second))
upper, lower = high_low(-4, 2)
print(upper - lower) # 6Ordering two measurements before taking their difference gives a nonnegative distance. abs(a - b) gives the same distance in one expression.
Complete measure(corner_a, corner_b). The tuples give opposite corners of an axis-aligned rectangle. Return (perimeter, area). Either corner may come first. Use abs to get a nonnegative distance between two coordinates.