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.
Remove Consecutive Duplicate Letters
Implement a function that removes consecutive duplicate letters from a string, keeping only one occurrence of each run.
Remove Duplicates from String
Given a string, return a new string with each character that repeats consecutively reduced to a single occurrence.
Count Syllables (Simple)
Count syllables in a word by counting groups of consecutive vowels (a, e, i, o, u).
Compress Consecutive Chars
Write a function that compresses a string by replacing runs of identical characters with the character followed by the count.
Validate username format
Implement a function that validates a username according to length, allowed characters, and no consecutive underscores.
Difference of Consecutive Elements
Given a list of numbers, return a new list where each element is the difference between consecutive elements.
Longest Run of Equal Values
Compute the length of the longest run (consecutive block) of equal elements in a list.
Window Iterator
Implement a generator that yields consecutive windows of a given size from any iterable.
Pairwise Sequence Pairs
Write a generator function pairwise that yields each consecutive overlapping pair from any iterable as lists.
Groupby Consecutive
Write a generator function that yields (value, list_of_occurrences) for each run of consecutive equal items.
Compress Bits Run
Write a function that compresses a binary string by representing consecutive identical bits as a count-bit pair.
Showing 12 challenges · easy
Guide: free Python coding challenges
Practice Python by solving problems
PythonSkillset challenges are hands-on coding exercises from beginner to advanced. Open a challenge, read the problem, write Python in the split-pane editor, and run tests with Pyodide — no install required.
How to use the arena
- Pick a category — basics, algorithms, strings, and more
- Open a challenge, read the statement, and edit the starter code
- Run tests, fix failures, then try a related quiz or tutorial lesson
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.