python check if integer is in range