Nearest Value Python Programming