Answers for "sort strings as numbers python"

0

sort strings as numbers python

a = sorted(a, key=lambda x: float(x))
Posted by: Guest on April-07-2021
0

sort strings as numbers python

>>> b = ["949.0","1099.0"]
>>> b.sort(key=float)
>>> b
['949.0', '1099.0']
Posted by: Guest on April-07-2021

Code answers related to "sort strings as numbers python"

Python Answers by Framework

Browse Popular Code Answers by Language