list1, list2 = [9.2,6.6,3.1,6.9], [1,2,3,4]
print list2[min((j,i) for i, j in enumerate(list1))[1]]
# 3
Explanation:
min((j,i) for i, j in enumerate(list1))
will give the smallest element along with its index. In this case, it will return (3.1, 2)
. So we take only the second element and get the element corresponding to it from list2
.
The other way to do the same would be
print min(zip(list1, list2))[1]
# 3