Pradeep Elance has Published 446 Articles

Check if both halves of the string have the same set of characters in Python

Pradeep Elance

Pradeep Elance

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

79 Views

We have to check whether two halves of a string have the same set of characters or not in Python. The frequency of the characters in the two halves must be identical. If the length of the string is odd, ignore the middle and check for the remaining characters. Follow ... Read More

Basic calculator program using Python program

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 08:14:26

1K+ Views

In this tutorial, we are going to build a basic calculator in Python. I think all of you have an idea about the basic calculators. We will give six options to the user from which they select one option, and we will perform the respective operation. Following are the arithmetic ... Read More

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

478 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

474 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

514 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

3K+ 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

5K+ 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

100 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

16K+ 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

Advertisements