Python String Coding Practice Problems
Last Updated :
08 Apr, 2025
Improve
This collection of Python string coding practice problems is designed to help you learn string manipulation.
- The following links contain coding problems where you need login first and then write code. Your code would be tested against expected output. You get points on the portal if your code's output matches and your code gets successfully submitted.
- In case you get an error after submission, you get proper message with the type of error (compiler error or your code is not matching expected output). You may either take a look at comments or use YOGI bot present on the error page to fix errors.
- The problems are organized according to difficult level. Please let us know in comments if you face any difficulty or have any feedback for us.
Easy problems
- Welcome aboard - Python
- Repeat the Strings - Python
- String Functions I - Python
- Regex - Python
- Convert String to LowerCase
- String Duplicates Removal
- Reverse String
- Check Palindrome
- Find Pattern
- Decimal number to binary number
- Binary number to decimal number
- String Functions - II - Python
- Regular Expressions 2 - Python
- Reverse Words
- Palindrome String
- Slice The String
- Change Case
- Print Alphabets
- Reverse words in a given string
- Longest Common Prefix
- Roman Number to Integer
- Integer to Roman
- Closest Strings
- Divisible by 7
- Encrypt the String – II
- Equal point in a string of brackets
- Isomorphic Strings
- Check if two strings are k-anagrams or not
- Panagram Checking
- Minimum Deletions
- Number of Distinct Subsequences
- Check if string is rotated by two places
Medium problems
- Implement Atoi
- Validate an IP address
- License Key Formatting
- Find the largest word in dictionary
- Equal 0,1, and 2
- Add Binary Strings
- Sum of two large numbers
- Multiply two strings
- Look and say Pattern
- Minimum times A has to be repeated to make B a Substring
- Excel Sheet – I
- Form a Palindrome
- Find the N-th character
- Next higher palindromic number using the same set of digits
- Length of longest prefix suffix
- Longest K unique characters substring
- Smallest window in string containing all characters
- Longest Palindromic Subsequence
- Longest substring without repeating characters
- Substrings of length k with k-1 distinct elements
- Count number of substrings
- Interleaved Strings
- Print Anagrams together
- Rank the permutation
- A Special Keyboard
Hard problems
- Restrictive Candy Crush
- Edit Distance
- Search Pattern (KMP-Algorithm)
- Search Pattern (Rabin-Karp Algorithm)
- Search Pattern (Z-algorithm)
- Shortest Common Supersequence
- Number of words with K maximum distinct vowels
- Longest substring to form a Palindrome
- Longest Valid Parenthesis
- Distinct Palindromic Substrings