Solution Exercise 55: Python sorting algorithm
Exercise 55 Write an algorithm in Python to sort a list according to the insertion sort algorithm. Solution # Python insertion sort algorithmdef sort_insertion (tab): # Browse from 1 to…
Solution Exercise 54: recursive sum of the elements of a Python list
Exercise 54 Write a Python algorithm as a function which takes as parameter a list of integers L = [n1, n2, n3, ...., np] and which returns the list: [n1,…
Solution Exercise 53: python algorithm which determines the penultimate index of an element in a list
Exercise 53 Write an algorithm in Python allowing to determine the penultimate index of an element in a list without using any predefined function in Python. Example if L =…
Solution Exercise 52: python algorithm which determines the list of indexes of an element a in list
Exercise 52 Write a Python program as a function which takes as parameters a tuple (L, a) formed by a list L and an element a of L and which…
Solution Exercise 51: list of elements duplicated at least 3 times without using any predefined method in Python
Exercise 51 Write a Python algorithm as a function which takes a list L as a parameter and which returns the list of elements duplicated at least 3 times without…
Solution Exercise 50: list of elements duplicated at least 3 times in Python
Exercise 50 Write a Python algorithm which returns the list of elements duplicated at least 3 times within a given list L . Solution # function which determines the elements…
Solution Exercise 49: Python algorithm that determines the maximum of elements with even index of a given list
Exercise 49 Write a Python algorithm as a function that takes a list L as a parameter and returns the maximum number of elements with even index without using any…