Solution Exercise 18: python algorithm which determines the symmetric difference of two lists
Exercise 18 Write a Python program that determines the symmetric difference of two lists L1 and L2, i.e. the list made up of the elements of L1 which are not…
Solution Exercise 17: python algorithm which determines the difference of two lists
Exercise17 Write a Python program that determines the difference of two lists. Example if: L1 = [11, 3, 22, 7, 13, 23, 9] L2 = [5, 9, 19, 23, 10,…
Solution Exercise 16: randomly mixes the elements of a given list
Exercise 16 Write a program in python that randomly mixes the elements of a given list. Solution from random import shufflelaptop = ['HP', 'Acer', 'Dell', 'Lenovo', 'Thomson', 'Asus']# mix the…
Solution Exercise 15: the list of common elements to two lists
Exercise 15 Write a Python program in the form of a Python function which takes two lists as parameters and returns the list of elements common to these two lists.…
Solution Exercise 14: common values of two python lists
Exercise14 Write a Python program as a function that takes two lists as parameters and returns True if the two lists have at least one common element and False if…
Solution Exercise 13: python algorithm to remove duplicate elements from a given list
Exercise 13 Write a python algorithm to remove duplicate elements from a list. Solution def removeDuplicate(L): # initializing the list without duplicate elements unique = [] for x in L:…
Solution Exercise 95*: algorithm python to find the most repeated word inside a given string
Exercise 95* Write a Python function to get any string/sentence and returns the most repeated word. Solution def most_repeated(s): # converting the string s to a list L = s.split()…