Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: simple min with key solution in Clear category for Nearest Value by Phil15
nearest_value=lambda s,v:min(s,key=lambda x:(abs(x-v),x))
March 18, 2019