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.…
Python Courses & Exercises with solutions !
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.…
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…
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:…
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()…
Exercise 94* Write a Python program as function that takes as parameter a string s and which returns the list repeated word within the string s. Example: if s =…
capitalize() Converts the first character to upper case casefold() Converts string into lower case center() Returns a centered string count() Returns the number of times a…
Exercise 22 Write an algorithm in python that returns the list of duplicate elements of a given list without using any predefined functions in Python. Example if L = [7,…