Return multiple values from a function in python

In python, there is a concept called unpacking values. What it does is, it allows us to assign values to multiple variables together at the same time. I think it is easier to explain this with an example. In this way we can unpack vales using python. But what happens if the variables and the […]

Read More

Statistics in python – mean, mode and median

In this article, we shall see how to perform some of the statistical functions such as mean, median, and mode. This can be done with the help of a python module called statistics. This module offers many more methods and functionalities than these three alone. The only three topics that will be discussed here are, […]

Read More

Reverse iteration in python

In this article, we shall see how to perform reverse iteration with python. Let us also see what reverse iteration is, where, and when to use it? Reverse iteration Usually, when we iterate any iterator in python the values are iterated from the first index to the last. But what if we want to iterate […]

Read More

Jumbled words solver using python

In this article, we shall see how to build a jumbled word solver using python. What this code basically does it takes a jumbled word and returns all the possible original words. How does it work? This code consists of the following two important steps. Find all the permutations of the word. Check if each […]

Read More

Find upload and download speed using python

In this python article, you are going to learn how to find the upload and download speed using python. This is made possible with the help of a python package called speedtest-cli. upload speed vs download speed Download speed is the speed that information on the Internet (e.g., text and graphics) is transferred to your computer; […]

Read More

Count the number of words and lines in a file using python

In this article, we shall see how to find the number of words and lines using python. File handling is pretty much easier with python with all the various available methods. Consider the have the following sample text file. I would love to try or hear the sample audio your app can produce. I do […]

Read More

Delete all occurrences of an element from a list in python

In this article we shall see how to remove all occurrences of an element from a list in python assuming that our list has duplicate elements. This can be done in a number of ways. Let us look at all the possible approaches one by one. The naive approach filter method with not equal operator […]

Read More

Environment variables in virtual environment using python

In this article we shall see what are environment variables in python, how to use them and why we should use them. They will come in handy if you want to hide sensitive information from your code. What are environment variables? Why it is used? Environment variables are commonly used for the following reasons. To […]

Read More

Find the frequency of words in a string using python in one line

If you are working with any text documents or paragraphs or files and if we want to do sentiment analysis, we will always come across a situation where we should know the frequency of the words. There is both traditional approach and a one-liner in python. Let us look at the traditional approach and the […]

Read More