Open In App

Python String Exercise

Last Updated : 09 Dec, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

Basic String Programs

Advance String Programs

Programs on SubString



Previous Article
Next Article

Similar Reads

Python List Exercise
Basic List ProgramsPython program to interchange first and last elements in a listPython program to swap two elements in a listPython – Swap elements in String listPython | Ways to find length of listMaximum of two numbers in PythonMinimum of two numbers in PythonPython | Ways to check if element exists in listDifferent ways to clear a list in Pyth
3 min read
Python Dictionary Exercise
Basic Dictionary ProgramsPython | Sort Python Dictionaries by Key or ValueHandling missing keys in Python dictionariesPython dictionary with keys having multiple inputsPython program to find the sum of all items in a dictionaryPython program to find the size of a DictionaryWays to sort list of dictionaries by values in Python – Using itemgetterWays
3 min read
Python Tuple Exercise
Basic Tuple ProgramsPython program to Find the size of a TuplePython – Maximum and Minimum K elements in TupleCreate a list of tuples from given list having number and its cube in each tuplePython – Adding Tuple to List and vice – versaPython – Sum of tuple elementsPython – Modulo of tuple elementsPython – Row-wise element Addition in Tuple MatrixP
3 min read
Python Set Exercise
Basic Set ProgramsFind the size of a Set in PythonIterate over a set in PythonPython - Maximum and Minimum in a SetPython - Remove items from SetPython - Check if two lists have at-least one element commonPython program to find common elements in three lists using setsPython - Find missing and additional values in two listsPython program to find th
2 min read
Python Exercise with Practice Questions and Solutions
Python Exercise: Practice makes you perfect in everything. This proverb always proves itself correct. Just like this, if you are a Python learner, then regular practice of Python exercises makes you more confident and sharpens your skills. So, to test your skills, go through these Python exercises with solutions. Python is a widely used general-pur
7 min read
Pandas and NumPy Exercise for Data Analysis
NumPy Exercises for Data AnalysisNumPy Array ExercisesHow to create an empty and a full NumPy array?Create a Numpy array filled with all zerosCreate a Numpy array filled with all onesCheck whether a Numpy array contains a specified rowHow to Remove rows in Numpy array that contains non-numeric values?Combining a one and a two-dimensional NumPy Arra
5 min read
Matplotlib - Practice, Exercise, and Solutions
Python Matplotlib is a library for visualization that helps to create a variety of charts in a variety of hardcopy formats. You might have seen various Matplotlib tutorials but the best way to gain a command over this library is by practicing more and more. This Matplotlib exercise helps you learn Matplotlib using a set of detailed questions for pr
5 min read
String slicing in Python to check if a string can become empty by recursive deletion
Given a string “str” and another string “sub_str”. We are allowed to delete “sub_str” from “str” any number of times. It is also given that the “sub_str” appears only once at a time. The task is to find if “str” can become empty by removing “sub_str” again and again. Examples: Input : str = "GEEGEEKSKS", sub_str = "GEEKS" Output : Yes Explanation :
2 min read
String slicing in Python to Rotate a String
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 d <= n).Right (Or clockwise) rotate the given string by d elements (where d <= n).Examples: Input : s = "GeeksforGeeks" d = 2Output : Left Rotation : "eksforGeeksGe" Right Rotation : "ksGeek
3 min read
Python | Check if given string can be formed by concatenating string elements of list
Given a string 'str' and a list of string elements, write a Python program to check whether given string can be formed by concatenating the string elements of list or not. Examples: Input : str = 'python' lst = ['co', 'de', 'py', 'ks', 'on'] Output : False Input : str = 'geeks' lst = ['for', 'ge', 'abc', 'ks', 'e', 'xyz'] Output : True Approach #1
5 min read
Practice Tags :