How to sort the python list that contains the float values,
list1 = [1, 1.10, 1.11, 1.1, 1.2]
or
list1 = ['1', '1.10', '1.11', '1.1', '1.2']
The expected results is
list_val = ['1', **'1.1', '1.2'**, '1.10', '1.11']
but the returned result in using sort() method returns
[1, 1.1000000000000001, 1.1000000000000001, 1.1100000000000001, 1.2]
or
['1', '1.1', '1.10', '1.11', '1.2'].
But, here 1.2
should come in between 1.1
and 1.10
.