min(range(len(a)), key=lambda i: abs(a[i]-11.5))

Read more of this post