Python String Methods
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…
Python Courses & Exercises with solutions !
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,…
Exercise 12 Using the sort () method, write an algorithm in python as a function which takes as parameter a list L of numbers and which returns the couple (min,…
Exercise 11 Write an algorithm in python as a function which takes as parameter a tuple (L, n) formed by a list L of numbers and an integer n and…
Exercise 10 Write an algorithm in python as a function which takes as a parameter a tuple (L, x) formed by a list L and an element x and which…
Exercise9 Write an algorithm in python as a function which takes as parameter a tuple (L, a) formed by a list L and an element a and which returns True…
Exercise8 Write an algorithm in python that returns the average of the terms in a list of numbers. Solution def averageList (L): # initialization of the average m = 0…