I am trying to get the minimum of a list and float, I had the following code but it was giving error
x=['14.99', '14.99', '15.00', '16.36']
y=21.00
min([float(i) for i in x.append(y)])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not iterable
#x= ['14.99', '14.99', '15.00', '16.36', 21.0] y got appended
However, if i do (append y before list comprehension)
x=['14.99', '14.99', '15.00', '16.36']
y=21.00
x.append(y)
min([float(i) for i in x])
Output is :14.99 #correct
How can I do this in one line?