I've a list of string which are numbers (float) from which I need to pick the max number in the list. Since these numbers represent software version of a particular component, 4.10 would be latest version and 4.1 would be the oldest. And so I am trying to find the latest version from this list.
version = ["4.1", "4.4", "4.5", "4.2", "4.9", "4.6", "4.7", "4.3", "4.8", "4.10"]
highest = max(map(float, version))
But since the float function here remove the trailing 0 for 4.10. The map output returns with 4.1's, so float is certainly not the correct way to retrieve the highest version.
["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "4.1"]
And so in above list "4.9" is returned as the highest version.
Can you please suggest on how to get the max float number from the list?