Pradeep Elance has Published 445 Articles

Nested list comprehension in python

Pradeep Elance

Pradeep Elance

Updated on 30-Dec-2019 10:32:32

2K+ Views

A nested list is a list within a list. Python provides features to handle nested list gracefully and apply common functions to manipulate the nested lists. In this article we will see how to use list comprehension to create and use nested lists in python.Creating a MatrixCreating a matrix involves ... Read More

Event scheduler in Python

Pradeep Elance

Pradeep Elance

Updated on 23-Dec-2019 10:35:38

2K+ Views

Python gives us a generic scheduler to run tasks at specific times. We will use a module called schedule. In this module we use the every function to get the desired schedules. Below is the features available with the every function..SynatxSchedule.every(n).[timeframe] Here n is the time interval. Timeframe can be ... Read More

Adding value to sublists in Python

Pradeep Elance

Pradeep Elance

Updated on 23-Dec-2019 10:35:02

723 Views

Sometimes we need to introduce an additional value to an already existing list. In this article we will see how the new value or values can be inserted into an already existing list by combining with each item of the existing list.Using For LoopIf we take a list which has ... Read More

Turtle graphics using Python

Pradeep Elance

Pradeep Elance

Updated on 23-Dec-2019 10:33:05

22K+ Views

Turtle is a Python library to draw graphics. After we import Turtle we can give commands like forward, backward, right, left etc. This commands will draw different shapes when we. When We combine Search commands we can create many nice graphics in the below example we will see some simple ... Read More

Python - Get the Index of first element greater than K

Pradeep Elance

Pradeep Elance

Updated on 23-Dec-2019 10:25:05

2K+ Views

The values of items in a python list are not necessarily in any sorted order. More over there may be situation when we are interested only in certain values greater than a specific value. In this article we will see how we can get theUsing EnumerationUsing enumeration we get both ... Read More

Python - Get sum of tuples having same first value

Pradeep Elance

Pradeep Elance

Updated on 23-Dec-2019 10:22:16

345 Views

Tuples are python collections or arrays which are ordered but unchangeable. If we get a number of tuples where the first element is the same, then we may have a scenario when we need to add the second elements of those tuples whose first elements are equal.Using map and for ... Read More

Python - geometry method in Tkinter

Pradeep Elance

Pradeep Elance

Updated on 23-Dec-2019 10:11:32

6K+ Views

Python has capability to create GUI applications using the Tkinter library. The library provides many methods useful for GUI applications. The geometry method is a fundamental one which decides the size, position and some other attributes of the screen layout we are going to create.Example - 1In the below program ... Read More

Python - Check if two lists have any element in common

Pradeep Elance

Pradeep Elance

Updated on 23-Dec-2019 10:09:16

4K+ Views

During manipulating data using python lists, we come across a situation where we need to know if two lists are entirely different from each other or they have any element in common. This can be found out by comparing the elements in the two lists with the below approaches decribed.Using ... Read More

Getting screens height and width using Tkinter Python

Pradeep Elance

Pradeep Elance

Updated on 23-Dec-2019 10:00:44

334 Views

Tkinter is the library which gives GUI programming capability to python programs. As part of GUI creation we need to create screen layouts of different sizes and depth. In this program we will see how to calculate the size of a screen in terms of pixels as well as in ... Read More

Boolean Indexing in Python

Pradeep Elance

Pradeep Elance

Updated on 20-Dec-2019 11:26:46

2K+ Views

The Boolean values like True & false and 1&0 can be used as indexes in panda dataframe. They can help us filter out the required records. In the below exampels we will see different methods that can be used to carry out the Boolean indexing operations.Creating Boolean IndexLet’s consider a ... Read More

Advertisements