I should write a function min_in_list(munbers), which takes a list of
numbers and returns the smallest one. NOTE: built-in function min is NOT allowed!
def min_in_list(numbers):
the_smallest = [n for n in numbers if n < n+1]
return the_smallest
What’s wrong?
You have to produce 1 number from list, not just another list. And this is work for
reducefunction (of course, you can implement it withoutreduce, but by analogy with it).