Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
lambda solution in Clear category for Nearest Value by David_Jones
def nearest_value(values, one):
return min(values, key=lambda x: (abs(x - one), x))
June 5, 2019
Comments: