List methods in python

In this article we are going to see about the various methods of the list data type. The 9 methods that we are going to see in this article are, append extend insert pop remove index count sort reverse Append The append() methods adds a new element at the end of the list. The following […]

Read More

Convert audio files to graph visualisation

In this article we shall how we can convert an audio file to its graph visualisation. The graph is plotted by taking the frequencies of the audio file as a numpy array. Let us get started. Libraries needed We will need the following two libraries for this task. soundfile matplotlib both can be installed via […]

Read More

Pip in python – installing, uninstalling, updating and listing packages

pip is the package installer for python. Pip is one of the most famous and widely used package management systems to install and manage software packages written in Python and found in the Python Package Index (PyPI). Most distributions of Python come with pip preinstalled. Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include […]

Read More

**kwargs in python

**kwargs is used when we want to pass variable length keyworded arguments to a function. A keyworded arguments will have a key value pair like name=”John” or {“name”:”John”}. Let us look into **kwargs with two examples. In the first example we will pass keyworded arguments of variable length. In the next example we will pass […]

Read More

Pass, break and continue in python

Pass Whenever we use any loops in python, try except statements or functions, it expects something to be on the next line. This is the general syntax of statements like these. Nothing happens when pass is executed. Its main purpose is to act as a placeholder where the interpreter expects a statement. Remember a colon-separated compound statements needs a header and a […]

Read More

String methods in python

Strings in Python provide a number of methods. Let’s have a look at them. These following 10 methods are explained in detail with an example for each. strip whitespaces replace substrings manipulate cases split strings join words isaplha(), isnumeric() occurrences of a substring where is the substring? endswith string formatting 1. Strip whitespaces The following […]

Read More

Find internet connectivity using python – requests

Let us imagine ourself creating a desktop application, where we want to check whether our system is connected to the internet, before proceeding to other tasks. In that situation, this little code snippet comes in handy. The requests library in python can be used to solve this task. Requests Requests is a Python HTTP library, […]

Read More

List, set and dictionary comprehension in python

List, set and dictionaries are some of the important data types in python. In these article we shall see the comprehension techniques of these data types. What is comprehension in python? Comprehensions in Python provide us with a short and concise way to construct new sequences (such as lists, set, dictionary etc.) using sequences which […]

Read More

create binary tree in python

what is a binary tree? A binary tree is a tree structure in which each element or node will have two children and not more than two. They are popularly called as left and right elements. A binary tree will have three things, data pointer to left child pointer to right child Presenting it step-by-step. […]

Read More