Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

467 challenges 330 easy 120 medium 17 hard
Strings & Text easy

Reverse a string

Return the characters of the string in reverse order.

strings slicing
+5 pts 5m
Strings & Text medium

Run-length encoding

Compress consecutive identical characters, e.g. 'aaabbc' → 'a3b2c1'.

strings compression
+20 pts 20m
Strings & Text easy

Remove punctuation

Write a function that removes all ASCII punctuation characters from a string.

strings punctuation cleaning
+10 pts 10m
Strings & Text easy

Is pangram

Write a function that determines whether a given string is a pangram, ignoring case and non-letter characters.

strings sets algorithm
+8 pts 12m
Strings & Text easy

Repeat each character n times

Given a string s and an integer n, return a new string where each character of s is repeated n times consecutively.

strings join comprehension
+8 pts 10m
Strings & Text easy

Normalize quotes

Replace all typographic quote characters with straight ASCII quotes.

strings replacement unicode
+10 pts 12m
Strings & Text easy

Interleave Two Strings

Given two strings s1 and s2, return a new string that interleaves them character by character, starting with s1.

strings merging loops
+8 pts 10m
Strings & Text easy

Sort characters alphabetically

Sort all characters in a string alphabetically and return the sorted string.

sorting string manipulation
+5 pts 5m
Strings & Text easy

Is pangram?

Implement is_pangram(s) to return True if the string contains every letter from 'a' to 'z' at least once, ignoring case and non-alphabetic characters.

strings set validation
+8 pts 10m
Strings & Text easy

Remove Duplicates from String

Given a string, return a new string with each character that repeats consecutively reduced to a single occurrence.

strings loop filter
+8 pts 10m
Strings & Text easy

Mask email address

Given an email address, return a masked version that hides everything but the first and last character of the local part and the domain.

strings masking validation
+8 pts 10m
Strings & Text easy

Extract digits from string

Write a function that extracts all digit characters from a given string, preserving their original order.

strings digits parsing
+6 pts 8m
Strings & Text easy

Is isogram?

Write a function that checks whether a given word is an isogram, ignoring letter case and only considering alphabetic characters.

strings case-insensitive set
+8 pts 12m
Strings & Text easy

Compress Consecutive Chars

Write a function that compresses a string by replacing runs of identical characters with the character followed by the count.

string run-length compression
+8 pts 12m
Strings & Text easy

Sort characters in string

Write a function that sorts the characters in a string and returns the sorted string.

sorting string character
+8 pts 10m
Strings & Text easy

Most Common Character

Return the character that appears most frequently in a string, breaking ties by earliest occurrence.

strings counting dictionary
+10 pts 15m
Strings & Text easy

Isomorphic Strings Check

Given two strings, check if they are isomorphic by verifying a one-to-one character mapping.

strings mapping hash-map
+10 pts 15m
Strings & Text easy

Validate username format

Implement a function that validates a username according to length, allowed characters, and no consecutive underscores.

strings validation returns
+8 pts 12m
Strings & Text easy

Hamming Distance

Implement a function that computes the Hamming distance between two strings of equal length.

strings character-comparison distance
+10 pts 15m

Showing 19 challenges · Strings & Text

Strings & Text — Python coding challenges

What you will find here

This page lists strings & text challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.

Challenges vs tutorials and quizzes

Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.