obtain closest value of a list code example Example: how to get index of closest value in list python min(range(len(a)), key=lambda i: abs(a[i]-11.5))