Skip to content

Tag Archives: python-string

In Python3, string.octdigits is a pre-initialized string used as string constant. In Python, string.octdigits will give the octadecimal letters ‘01234567’. Syntax : string.octdigits Parameters :… Read More
In Python3, string.punctuation is a pre-initialized string used as string constant. In Python, string.punctuation will give the all sets of punctuation. Syntax : string.punctuation Parameters… Read More
In Python3, string.whitespace is a pre-initialized string used as string constant. In Python, string.whitespace will give the characters space, tab, linefeed, return, formfeed, and vertical… Read More
Yet another problem regarding the interconversion between data types is conversion of string of list to a dictionary of keys and values. This particular problem… Read More
Given two strings str and pattern, find the smallest substring in str containing all characters of pattern efficiently. Examples: Input : str = 'geeksforgeeks' pattern… Read More
Given a String (may contain both letters and digits), write a Python program to find the longest consecutive letter and digit substring. Examples: Input :… Read More
Given a string (may contain both characters and digits), write a Python program to remove the numeric digits from string. Let’s discuss the different ways… Read More
Given a string (be it either string of numbers or characters), write a Python program to split the string by every nth character. Examples: Input… Read More
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
Given a list of strings, write a Python program to convert all string from lowercase/uppercase to uppercase/lowercase. Input : ['GeEk', 'FOR', 'gEEKS'] Output: ['geeks', 'for',… Read More
Given a string, write a Python program that checks if the given string is keyword or not. Keywords are reserved words which cannot be used… Read More
Given a string, write a Python program to split the characters of the given string into a list.  Examples:   Input : geeks Output : ['g',… Read More
Given a string, write a Python program to check if that string is Pangram or not. A pangram is a sentence containing every letter in… Read More
Sometimes we come forward to the problem in which we receive a list that consists of strings and characters mixed and the task we need… Read More
Given an expression string, write a python program to find whether a given string has balanced parentheses or not. Examples: Input : {[]{()}} Output :… Read More

Start Your Coding Journey Now!