Pradeep Elance has Published 445 Articles

Check if list is strictly increasing in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:39:04

945 Views

Given a list, we may need to check for the sequence of its elements. In this article we will find out if the elements present in the list are in a strictly increasing order. Below programs achieve that objective.With all and zipIn this approach we first slice each element compare ... Read More

Check if list is sorted or not in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:35:11

4K+ Views

Lists are the most widely used data collectios in python. We may come across situation when we need to know if the given list is already sorted or not. In this article we will see the approaches to achieve this.With sortWe take a copy of the given list, apply sort ... Read More

Check if list contains consecutive numbers in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:32:52

3K+ Views

Depending on the needs of our data analysis we may need to check for presence of sequential numbers in a python data container. In the below programs we find out if among the elements of Alist, there are any consecutive numbers.With range and sortedThe sorted function will rearrange the elements ... Read More

Check if given string can be formed by concatenating string elements of list in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:30:47

474 Views

We sometimes need to check if a required string can be formed from many number of strings that are present in a list. It also should not matter in what order the strings are present in the list which have to be joined to get the required string.With permutationsFrom itertools ... Read More

Check if given multiple keys exist in a dictionary in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:27:28

1K+ Views

During data analysis using python, we may need to verify if a couple of values exist as keys in a dictionary. So that the next part of the analysis can only be used with the keys that are part of the given values. In this article we will see how ... Read More

Check if element is present in tuple of tuples in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:24:13

973 Views

Python Tuples can be nested. We can have a tuple whose elements are also tuples. In this article we will see how to find out if a given value is present as an element in a tuple of tuples.With anyThe any function can be used to check if a given ... Read More

Check if element exists in list of lists in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:19:28

2K+ Views

Lists can be nested, means the elements of a list are themselves lists. In this article we will see how to find out if a given element is present in the sublist which are themselves elements in the bigger list.With anyWe first search if an element is present in the ... Read More

Check if a list exists in given list of lists in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:14:28

548 Views

Lists can be nested, means the elements of a list are themselves lists. In this article we will see how to find out if a given list is present as an element in the outer bigger list.With inThis is a very simple and straight forward method. We use the in ... Read More

Assign range of elements to List in Python

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:10:36

382 Views

Lists are very frequently used data container in Python. While using lists we may come across a situation where the elements of the list maybe a sequence of numbers. We can add this sequence of numbers to a list using many Python functions. In this article we will explore different ... Read More

Assign multiple variables with a Python list values

Pradeep Elance

Pradeep Elance

Updated on 13-May-2020 14:08:51

2K+ Views

Depending on the need of the program we may an requirement of assigning the values in a list to many variables at once. So that they can be further used for calculations in the rest of the part of the program. In this article we will explore various approaches to ... Read More

Advertisements