Python Check If Value In Interval