I have the following code:
l = [\'-1.2\', \'0.0\', \'1\']
x = 100.0
for i in l:
if i < x:
x = i
print x
The code should fin
It looks like you want to convert the list to a list of numbers
>>> foo = ['-1.2', '0.0', '1']
>>> bar = map(float, foo)
>>> bar
[-1.2, 0.0, 1.0]
>>> min(bar)
-1.2
or if it really is strings you want, that you want to use min's key argument
>>> foo = ['-1.2', '0.0', '1']
>>> min(foo, key=float)
'-1.2'