Pradeep Elance has Published 298 Articles

Create a stopwatch using python

Pradeep Elance

Pradeep Elance

Updated on 19-Dec-2019 11:40:26

1K+ Views

A stopwatch is used to measure the time interval between two events usually in seconds to minutes. It has various usage like in sports or measuring the flow of heat, current etc in an industrial setup. Python can be used to creat a stopwatch by using its tkinter library.This library ... Read More

Find all the patterns of “1(0+)1” in a given string using Python Regex

Pradeep Elance

Pradeep Elance

Updated on 23-Oct-2019 08:22:30

289 Views

In this tutorial, we are going to write a program which finds all the occurrences of the 1(0+1) in a string using the regexes. We have a re module in Python which helps us to work with the regular expressions.Let's see one sample case.Input: string = "Sample 1(0+)1 string with ... Read More

FuzzyWuzzy Python library

Pradeep Elance

Pradeep Elance

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

819 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

756 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

791 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

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

868 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

getpass() and getuser() in Python (Password without echo)

Pradeep Elance

Pradeep Elance

Updated on 17-Oct-2019 12:53:09

2K+ Views

When you create some python programs that need password protection before it can run, we take the help of the getpass() and getuser() modules. They have a variety of functionalities that can be used to manage password protection as well as password retrieval etc. In this article, we will see ... Read More

Advertisements