Range Detection In Python With Example