Solution Exercise 10: python algorithm that returns the position of an element in a list

Exercise 10

Write an algorithm in python as a function which takes as a parameter a tuple (L, a) formed by a list L and an element 'a' and which returns the position of the element 'a' in the list L. The function must return -1 if the element 'a' is not in the list.

Solution




 

Younes Derfoufi
CRMEF OUJDA

1 thought on “Solution Exercise 10: python algorithm that returns the position of an element in a list

Leave a Reply

Your email address will not be published. Required fields are marked *