0
I want to know the smallest number of this list, which I present below the code.
I don’t know where I’m going wrong, I think I need to convert the list.
Example:
lista=[1, 3, 5]
def min(values):
smallest = None
for value in values:
if smallest is None or values < smallest:
smallest = value
return smallest
menorvalor=min(lista)
The mistake you make is this
Typeerror: '<' not supported between instances of 'list' and 'int'
correct value < smallest
– Bacco
values < smallest
- shouldn’t bevalue < smallest
? (value
in the singular instead ofvalues
plural)– hkotsubo