Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Sorted dict solution in Creative category for Nearest Value by bostonz1
def nearest_value(values, one):
lst = []
for num in values:
lst.append(abs(one-num))
my_dct = dict(zip(values, lst))
return min(sorted(my_dct), key=my_dct.get)
May 16, 2020
Comments: