![features-Python-courses-python-exercises-python-oop](https://1.bp.blogspot.com/-T3BongcoJFo/X4CftQxVL8I/AAAAAAAAB5U/Lf59WgNyhGo2FdogKqxv0PIy_Ef7XDPdgCLcBGAsYHQ/s0/my-python-courses-python-exercises-with-solutions.png)
Exercise 19
Write an algorithm in python as a function which takes as parameter a list of numbers L and which returns the minimum of the list without using any predefined function in Python.
Solution
def minimumList (L):
# initializing the minimum of the list
minList = L [0]
for x in L:
if minList> x:
minList = x
return minList
#Example
L = [15, 31, 12, 7, 19, 23, 29]
print ("The minimum of list L is:", minimumList (L))
# The output is: The minimum of the list L is: 7
Younes Derfoufi
my-courses.net
my-courses.net