Pradeep Elance has Published 445 Articles

Python - Deque

Pradeep Elance

Pradeep Elance

Updated on 14-Feb-2020 07:27:43

350 Views

In Python deque is a data structure like stack and queue. It allows append and pop operations from both the ends of the queue. And that makes it different from the rest of the data structures. There are various operations which are listed below that is applicable to deque. In ... Read More

Add trailing Zeros to a Python string

Pradeep Elance

Pradeep Elance

Updated on 14-Feb-2020 07:14:37

3K+ Views

As part of data processing activity we sometimes need to append one string with another. In this article we will see how to append dynamic number of zeros to a given string. This can be done by using various string functions as shown in the programs below.Using ljust and lenPython ... Read More

Programs for printing pyramid patterns in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Feb-2020 07:35:31

1K+ Views

Taking advantage of the for loop and range function in python, we can draw a variety of for pyramid structures. The key to the approach is designing the appropriate for loop which will leave both vertical and horizontal space for the position of the symbol we choose for drawing the ... Read More

Program to make Indian Flag in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Feb-2020 07:22:08

2K+ Views

Python’s libraries to draw graphs has very extensive features which can not only give us charts but also give us flexibility to draw other diagrams like flags. In that sense those modules have an artistic touch. In this article we will see how to draw the Indian flag using the ... Read More

Program to create grade calculator in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Feb-2020 07:15:38

2K+ Views

In Academics it is a common requirement to find the grades of students after an assessment. In this article we will create a Python program which will assign the grades based on the grading criteria. Will call it A grade calculator.Grading criteriaBelow is the grading criteria we have chosen for ... Read More

Print number with commas as 1000 separators in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Feb-2020 07:05:34

420 Views

Many times the numbers with three or more digits need to be represented suitably using comma. This is a requirement mainly in the accounting industry as well as in the finance domain. In this article we'll see how Python program can be used to insert a comma at a suitable ... Read More

Print first n distinct permutations of string using itertools in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Feb-2020 07:01:25

266 Views

Permutation of a number of objects is the representation of how the updates can be present in different sequences. But sometimes we may have two objects in a series of given objects which are identical. In that case two sequences will become equal. In this article will see how to ... Read More

Prime or not in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Feb-2020 06:52:09

661 Views

Prime numbers play a central role in many e it applications like cryptography. So it is a necessity to check for prime numbers using Python programs in various applications. A prime number is a number which doesn't have any factors other than one and itself. Below will see programs that ... Read More

MySqldb Connection in Python

Pradeep Elance

Pradeep Elance

Updated on 04-Feb-2020 06:44:47

221 Views

Mysql is one of the most widely used open source Dbs. Python provides ways to connect to this DB and use the DB to store and retrive the data from it.Install pymysqlDepending on the python environment you are using, pymysql package can be installed using one of the following methods.# ... Read More

Maximum length of consecutive 1’s in a binary string in Python using Map function

Pradeep Elance

Pradeep Elance

Updated on 04-Feb-2020 06:41:11

337 Views

Sometimes when dealing with the binary representation of numbers we may be needed to find out how many continuous 1’s are present in the number. This article shows two ways how we can find out that.Using Split and MapThe split function in python can be used to split the given ... Read More

Advertisements