Skip to content

Tag Archives: python-list-functions

Given a string S, the task is to print permutations of all words in a sentence. Examples: Input: S = “sky is blue”Output:  sky is… Read More
Given a string S of length N, representing a sentence, the task is to print the words with the highest and lowest average of ASCII… Read More
Lists are just like dynamically sized arrays, declared in other languages (vector in C++ and ArrayList in Java). Lists need not be homogeneous always which… Read More
Python Lists have various in-built methods to remove items from the list. Apart from these, we can also use del statement to remove an element… Read More
Using ‘+’ operator to add an element in the list in Python: The use of the ‘+’ operator causes Python to access each element of… Read More
List in Python is mainly implementation of dynamic sized arrays (like ArrayList in Java or vector in C++). Capacity of a list means number of… Read More
Given a String S, a character array ch[], a number N and a replacing character, the task is to replace every Nth occurrence of each… Read More
Sometimes, there is a need to reuse any object, hence copy methods are always of a great utility. Python in its language offers a number… Read More
There are many ways of clearing the list through methods of different constructs offered by Python language. Let’s try to understand each of the method… Read More
In python, iter() method is used to convert to convert an iterable to iterator. This presents another way to iterate the container i.e access its… Read More
Binary Search is a technique used to search element in a sorted list. In this article, we will looking at library functions to do Binary… Read More
The sort function can be used to sort a list in ascending, descending or user defined order. To sort the list in ascending order. List_name.sort()… Read More
pop() is an inbuilt function in Python that removes and returns last value from the list or the given index value. Syntax : list_name.pop(index) Parameter… Read More
index() is an inbuilt function in Python, which searches for a given element from the start of the list and returns the lowest index where… Read More
insert() is an inbuilt function in Python that inserts a given element at a given index in a list. Syntax : list_name.insert(index, element) Parameters :… Read More