The requested sort function
clone this repository and import the thoughtful-sort.py file. the function is sort(length, width, height, mass).
The function only allows for float values to avoid unnecessary numeric checks and improve performance.
There is a single loop under the hood instead of using multiple any() calls.