I have a 3D coordinate tuple (x, y, z). I want to test that none of the 3 co-ords of a given tuple are below (a, b, c) and none are higher than (d, e, f). Through trial, error, and reading these forums I've learned that:
(a, b, c) <= (x, y, z) <= (d, e, f)
doesn't work as the first expression evaluates, then gets that outcome (0 or 1) and uses it in the next evaluation, and so on. So now I tried:
((a, b, c) <= (x, y, z)) and ((x, y, z) <= (d, e, f))
This doesn't work either because when it hits a True in any of the three paired comparisons (a, x; b, y; c, z; etc), it results in True. As such, tuple comparisons work more like decimal values rather than three separate scalar variables. I need any failure of all three pair-comparisons (six in total) to produce a False result rather than any success to produce a True.
I hoped for a method as sweetly simple as a <= b <= c. What is a simple method of doing this with tuples that only produces True when all pair-wise comparisons pass?