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 medium

Run-length encoding

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

strings compression
+20 pts 20m
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

Remove Consecutive Duplicate Letters

Implement a function that removes consecutive duplicate letters from a string, keeping only one occurrence of each run.

strings loops manipulation
+10 pts 15m
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

Count Syllables (Simple)

Count syllables in a word by counting groups of consecutive vowels (a, e, i, o, u).

strings vowels counting
+10 pts 15m
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

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
Lists & Arrays easy

Difference of Consecutive Elements

Given a list of numbers, return a new list where each element is the difference between consecutive elements.

list iteration math
+8 pts 10m
Lists & Arrays easy

Longest Run of Equal Values

Compute the length of the longest run (consecutive block) of equal elements in a list.

lists consecutive run-length
+8 pts 10m
Data Structures & Algorithms medium

Longest Consecutive Sequence

Given an unsorted list of integers, find the length of the longest consecutive elements sequence in O(n) time.

hash set array linear
+20 pts 20m
Iterators & Generators easy

Window Iterator

Implement a generator that yields consecutive windows of a given size from any iterable.

generators yield sliding-window
+8 pts 12m
Iterators & Generators easy

Pairwise Sequence Pairs

Write a generator function pairwise that yields each consecutive overlapping pair from any iterable as lists.

generators iterators pairs
+10 pts 15m
Iterators & Generators easy

Groupby Consecutive

Write a generator function that yields (value, list_of_occurrences) for each run of consecutive equal items.

generator groupby consecutive
+8 pts 12m
Bit Manipulation easy

Compress Bits Run

Write a function that compresses a binary string by representing consecutive identical bits as a count-bit pair.

bit-manipulation strings compression
+10 pts 15m

Showing 14 challenges

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

  1. Pick a category — basics, algorithms, strings, and more
  2. Open a challenge, read the statement, and edit the starter code
  3. 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.