Skip to content

Tag Archives: Python string-programs

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 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
Given a string with duplicate characters allowed, print first n permutations of given string such that no permutation is repeated. Examples: Input : string =… Read More
Data preprocessing is an important task in text classification. With emergence of Python in the field of data science, it is essential to have certain… Read More
Sometimes we need to work with just the lists and hence strings might need to be converted into lists. It has to be converted in… Read More
We sometimes come through the situations where we require to get all the works present in the string, this can be a tedious task done… Read More
Given a string str, the task is to extract all the numbers from a string and find out the most occurring element of them using… Read More
Dictionary in python is a very useful data structure and at many times we see problems regarding converting a string to a dictionary. So, let… Read More
In Python, while operating with String, one can do multiple operations on it. Let’s see how to iterate over characters of a string in Python.… Read More
Given a list of dates in string format, write a Python program to sort the list of dates in ascending order. Examples: Input : dates… Read More
Write a Python program to convert a given string to datetime and vice-versa. Program to convert string to DateTime using strptime() function. Examples: Input :… Read More
Given a list, write a Python program to convert the given list to string. There are various situation we might encounter when a list is… Read More
Given a tuple of characters, Write a python program to convert the tuple into a string. Examples: Input : ('a', 'b', 'c', 'd', 'e') Output… Read More