Python mendapatkan nilai terdekat dalam daftar

def takeClosest(num,collection):
   return min(collection,key=lambda x:abs(x-num))
Terrible Tarantula