Skip to content

Tag Archives: Python string-programs

Given a string, count the number of vowels present in given string using Sets. Prerequisite: Sets in Python Examples: Input : GeeksforGeeks Output : No.… Read More
In this program, we will be taking a password as a combination of alphanumeric characters along with special characters, and check whether the password is… Read More
In this program, we need to count the number of vowels present in a string and display those vowels. This can be done using various… Read More
In this program, we will try to convert a given string to a list, where spaces or any other special characters, according to the users… Read More
The problem is quite simple. Given a string, we need to replace all commas with dots and all dots with the commas. This can be… Read More
Given two strings, check if s1 is there in s2. Examples: Input : s1 = geeks s2=geeks for geeks Output : yes Input : s1… Read More
Given a name, print the initials of a name(uppercase) with last name(with first alphabet in uppercase) written in full separated by dots. Examples: Input :… Read More
Two strings are given and you have to modify 1st string such that all the common characters of the 2nd string have to be removed… Read More
Prerequisite : Dictionary data structure Given a string, Find the 1st repeated word in a string. Examples: Input : "Ravi had been saying that he… Read More
Given two strings, print all the common characters in lexicographical order. If there are no common letters, print -1. All letters are lower case. Examples:… Read More
Given a string that has set of words and spaces, write a program to move all spaces to front of string, by traversing the string… Read More
Given a string of size n, write functions to perform following operations on string. Left (Or anticlockwise) rotate the given string by d elements (where… Read More
Given few lines of code inside a string variable and execute the code inside the string. Examples:   Input: code = """ a = 6+5 print(a)""" Output:… Read More
We are given a string and we need to reverse words of a given string? Examples: Input : str = geeks quiz practice code Output… Read More
Given a string, write a python function to check if it is palindrome or not. A string is said to be palindrome if the reverse… Read More