Pradeep Elance has Published 417 Articles

Calculate n + nn + nnn + … + n(m times) in Python program

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 08:08:59

2K+ Views

We are going to write a program that calculates the following series in Python. Examine the example inputs and outputs for the program that we are going to write.Input: 34 3 + 33 + 333 + 3333 Output: 3702Input: 5 5 5 + 55 + 555 + 5555 + 55555 ... Read More

FuzzyWuzzy Python library

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 08:01:52

724 Views

In this tutorial, we are going to learn about the FuzzyWuzzy Python library. FuzzyBuzzy library is developed to compare to strings. We have other modules like regex, difflib to compare strings. But, FuzzyBuzzy is unique in its way. The methods from this library returns score out of 100 of how ... Read More

Print anagrams together in Python using List and Dictionary

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 07:52:49

684 Views

In this tutorial, we are going to write a program which finds and prints anagrams using list and dictionary. We have different approaches to every problem. Try to write code without following the tutorial. If you are not able to generate any ideas to write logic, follow the below steps.Algorithm1. ... Read More

Print first m multiples of n without using any loop in Python

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 07:48:16

726 Views

In this tutorial, we are going to write a program to find out m multiples of a number n without using loops. For example, we have a number n = 4 and m = 3, the output should be 4, 8, 12. Three multiples of four. Here, the main constraint ... Read More

Python program to count occurrences of a word in a string

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 07:36:17

4K+ Views

In this tutorial, we are going to write a program that counts the number of times a word occurs in the string. You are given the word and a string, we have to calculate the frequency of the word in the string.Suppose we have a string I am a programmer. ... Read More

Sort a list according to the Length of the Elements in Python program

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 06:54:17

6K+ Views

We have a list of strings and our goal is to sort the list based on the length of strings in the list. We have to arrange the strings in ascending order according to their lengths. We can do this using our algorithms or Python built-in method sort() or function ... Read More

Sort Tuples in Increasing Order by any key in Python program

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 06:53:14

201 Views

In this tutorial, we are going to sort a list of tuples in increasing order by nth index key. For example, we have a list of tuples [(2, 2), (1, 2), (3, 1)] then, we have to sort it using 0th index element. The output for that list would be ... Read More

Reverse words in a given String in Python

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 06:48:45

19K+ Views

We are given a string, and our goal is to reverse all the words which are present in the string. We can use the split method and reversed function to achieve the output. Let's see some sample test cases.Input: string = "I am a python programmer" Output: programmer python a ... Read More

How to run Python code on Google Colaboratory?

Pradeep Elance

Pradeep Elance

Updated on 17-Oct-2019 13:25:07

776 Views

Google Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. It is hosted in google cloud and maintained by Google for the benefit of python coders who want to run and test python scripts using a cloud environment. In this article, we ... Read More

How to implement Dictionary with Python3

Pradeep Elance

Pradeep Elance

Updated on 17-Oct-2019 13:20:17

271 Views

Dictionaries in python are a type of data structure that map keys to values as a key-value pair. They are one of the frequently used data structures and have many interesting properties. They are presented by enclosing them in a pair of curly brace like below.dict = {'day1':'Mon' ,'day2':'Tue', 'day3':'Wed'}The ... Read More

Advertisements