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
You have to start somewhere the correct code should be:
The code to return the minimum value
l = [ '0.0', '1','-1.2']
x = l[0]
for i in l:
if i < x:
x = i
print x
But again it's good to use directly integers instead of using quotations ''
This way!
l = [ 0.0, 1,-1.2]
x = l[0]
for i in l:
if i < x:
x = i
print x