Skip to content

Tag Archives: Python-string-functions

In this article, we will discuss finding unique lines from two text files and storing them using Python. To understand the concept we will take… Read More
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… Read More
In this article, we will learn how to pad or add leading zeroes to the output in Python. Example: Input: 11 Output: 000011 Explanation: Added… Read More
Python String rjust() method returns a new string of a given length after substituting a given character on the left side of the original string.… Read More
Python String ljust() method left aligns the string according to the width specified and fills the remaining space of the line with blank space if… Read More
Python String maketrans() function is used to construct the transition table i.e specify the list of characters that need to be replaced in the whole… Read More
Python string is a sequence of Unicode characters that is enclosed in the quotations marks. In this article, we will discuss the in-built function i.e.… Read More
Given a string S and an integer N, the task is to remove N characters from the end of the string S. Input: S =… Read More
In Python, to find the index of a substring in a string can be located by python’s in-built function using find() or index(). Both of… Read More
In this article, the task is to display the scientific notation as float in Python. The scientific notation means any number expressed in the power… Read More
Both title() and capitalize() have similar functionality of capitalizing first characters. Let us see the difference between the two of them. Method 1: title()  … Read More
Python String removeprefix() function removes the prefix and returns the rest of the string. If the prefix string is not found, then it returns the… Read More
Given a string in Python. The task is to check whether the string has at least one letter(character) and one number. Return “True” if the… Read More
Prerequisites: Python – format() function str.format() is one of the string formatting methods in Python3, which allows multiple substitutions and value formatting. This method lets… Read More
Title case is a style of writing that is used for the titles of articles, books, movies, and other works. The rules for writing in… Read More

Start Your Coding Journey Now!