Python String index() Method
Python String index() Method allows a user to find the index of the first occurrence of an existing substring inside a given string in Python....
read more
Python program to find the longest word in a sentence
Given a string S consisting of lowercase English alphabets, the task is to print the longest word present in the given string in python....
read more
Python string | hexdigits
In Python3, string.hexdigits is a pre-initialized string used as string constant. In Python, string.hexdigits will give the hexadecimal letters ‘0123456789abcdefABCDEF’....
read more
ascii_letters in Python
In Python3, ascii_letters is a pre-initialized string used as string constant. ascii_letters is basically concatenation of ascii_lowercase and ascii_uppercase string constants. Also, the value generated is not locale-dependent, hence, doesn’t change....
read more
Python | Find all possible substrings after deleting k characters
Given a string and an Integer k, write a Python program to find all possible substrings of the given string after deleting k characters. Examples:...
read more
Python | Get the smallest window in a string containing all characters of given pattern
Given two strings str and pattern, find the smallest substring in str containing all characters of pattern efficiently. Examples:...
read more
Program to replace a word with asterisks in a sentence
For the given sentence as input, censor a specific word with asterisks ‘ * ‘....
read more
expandtabs() method in Python
Python String expandtabs() Method specifies the amount of space to be substituted with the “\t” symbol in the string....
read more
How to Round Floating Value to Two Decimals in Python
In this article, we will round off a float value in Python to the nearest two decimal places. Python provides us with multiple approaches to format numbers to 2 decimal places....
read more
Working with Strings in Python 3
In Python, sequences of characters are referred to as Strings. It used in Python to record text information, such as names. Python strings are “immutable” which means they cannot be changed after they are created....
read more
Python string isdecimal() Method
Python String isdecimal() function returns true if all characters in a string are decimal, else it returns False. In this article, we will explore further the isdecimal() method, understand its functionality, and explore its practical applications in Python programming....
read more
Change case of all characters in a .txt file using Python
In this article, we will learn how to change the case of all characters present in a text file using Python. We will use Python methods Python upper() to change all characters to upper case, and Python lower() to change all characters to lower case....
read more