Pradeep Elance has Published 446 Articles

Python - Column deletion from list of lists

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:34:40

825 Views

In a list of lists an element at the same index of each of the sublist represents a column like structure. In this article we will see how we can delete a column from a list of lists. Which means we have to delete the element at the same index ... Read More

Python - Check if given words appear together in a list of sentence

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:32:49

934 Views

Say we have a list containing small sentences as its elements. We have another list which contains some of the words used in this sentences of the first list. We want to find out if two words from the second list are present together in some of the sentences of ... Read More

Python - Check if all elements in a list are identical

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:30:02

628 Views

There may be occasions when a list will contain all the values which are same. In this article we will see various way to verify that.With allWe use the all function to find the result of comparison of each element of the list with the first element. If each comparison ... Read More

Python - Check if a list is contained in another list

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:28:07

801 Views

Given two different python lists we need to find if the first list is a part of the second list.With map and joinWe can first apply the map function to get the elements of the list and then apply the join function to cerate a comma separated list of values. ... Read More

Python - Check if a given string is binary string or not

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:25:39

5K+ Views

In this article we check if a given string has characters which are only 1 or 0. We call such strings as binary strings. If it has any other digit like 2 or 3 etc., we classify it as a non-binary string.With setThe set operator in python stores only unique ... Read More

Password validation in Python

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:22:16

2K+ Views

It is a general requirement to have a reasonably complex password. In this article we will see how to validate if a given password meats certain level of complexity. For that will use the regular expression module known as re.Example -1First we create a regular expression which can satisfy the ... Read More

Multi-dimensional lists in Python

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:19:39

7K+ Views

Lists are a very widely use data structure in python. They contain a list of elements separated by comma. But sometimes lists can also contain lists within them. These are called nested lists or multidimensional lists. In this article we will see how to create and access elements in a ... Read More

MongoDB and Python

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:17:08

548 Views

MongoDB is a widely used document database which is also a form of NoSQL DB. Python can interact with MongoDB through some python modules and create and manipulate data inside Mongo DB. In this article we will learn to do that. But MongoDB should already be available in your system ... Read More

Launching parallel tasks in Python

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:15:01

281 Views

If a Python program can be broken into subprograms who is processing do not depend on each other, then each of the subprogram can be run in parallel when the overall program is being run. This concept is known as parallel processing in Python.With multiprocessingThis module can be used to ... Read More

Interpreting stat() results using Python

Pradeep Elance

Pradeep Elance

Updated on 10-Jul-2020 11:12:28

277 Views

The stat() method is part of OS module which describes various OS related operations on files and directories. For example, if we want to know various user defined flags for a file or size of the file in bytes.Functions in os.stat() moduleBelow is a list of some sample functions available ... Read More

Advertisements