numbers = ['1.46', '1.59', '1.43', '1.42', '1.45', '1.65', '1.35', '1.39', '1.55', '1.88', '1.43']
All I want is to get the list of the 3 closest numbers to each other.
In this case the numbers would be 1.43 1.42 1.43.
I can not find any help anywhere. Some people use an input for example
test = nsmallest(3, price, key=lambda x: abs(x - 1.42))
but I don't want to put an input.