[python] How to find whether a number belongs to a particular range in Python?