Practice Arena

Python Coding Challenges

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

577 challenges 370 easy 180 medium 27 hard
Python Basics easy

Set symmetric difference

Write a function that returns the elements found in exactly one of two sets, sorted ascending.

sets symmetric-difference sorting
+10 pts 15m
Python Basics easy

Remove Duplicates from Sorted Array

Given a sorted list, remove duplicates in-place and return the new length.

lists in-place two-pointers
+10 pts 15m
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

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

Remove duplicates (sorted)

Return a sorted list with duplicates removed.

arrays two-pointer
+10 pts 10m
Lists & Arrays easy

Merge two sorted arrays

Merge two sorted arrays into one sorted array.

arrays merge two-pointer
+12 pts 12m
Lists & Arrays easy

Insert into a Sorted List

Implement a function that inserts a value into a sorted list at the correct position using binary search.

lists binary-search insertion
+10 pts 10m
Lists & Arrays easy

Intersection of Two Lists

Given two lists, return a sorted list of unique elements that appear in both lists.

intersection sorting unique
+10 pts 15m
Lists & Arrays easy

Merge Sorted Array In Place

Write a function that merges two sorted arrays into the first array in-place, keeping the result sorted.

arrays sorting in-place
+10 pts 15m
Lists & Arrays easy

Cartesian Product Pairs

Create a function that returns the Cartesian product of two lists as a sorted list of lists.

lists tuples sorting
+8 pts 12m
Dicts & Sets easy

List intersection

Return the sorted list of elements common to both lists.

sets intersection
+8 pts 8m
Dicts & Sets easy

Keys Sorted by Value Descending

Given a dictionary mapping strings to integers, return a list of keys sorted by value descending, and when values tie, alphabetically ascending.

sorting dictionaries ordering
+8 pts 10m
Dicts & Sets easy

Anagram Dictionary Groups Lite

Group a list of words into anagrams using a dictionary keyed by sorted characters.

dicts strings anagrams
+10 pts 15m
Dicts & Sets easy

Common Keys of Two Dictionaries

Implement a function that finds keys shared by two dictionaries and returns them sorted.

dict set sorting
+8 pts 10m
Dicts & Sets easy

Union of Many Sets

Implement a function that takes any number of sets and returns a sorted list of their union.

sets union flatten
+10 pts 10m
Dicts & Sets easy

Anagram Groups by Size

Group a list of words into anagram groups and return them sorted by group size and lexicographically.

dicts sets sorting
+10 pts 10m
Dicts & Sets easy

Top K Frequent Words

Given a list of words, return the k most frequent words sorted by frequency (descending) and then alphabetically.

dictionary sorting frequency
+10 pts 15m
Dicts & Sets easy

Symmetric Difference

Write a function that computes the symmetric difference of two lists, returning a sorted list of unique elements.

sets set-operations symmetric-difference
+8 pts 10m
Data Structures & Algorithms easy

Binary search

Return the index of target in a sorted list, or -1 if not present.

searching binary-search
+12 pts 12m
Data Structures & Algorithms easy

Exponential Search

Implement exponential search to find any valid index of a target in a sorted list.

searching sorted-array algorithms
+10 pts 15m
Math & Number Theory easy

Sieve of Eratosthenes

Implement the Sieve of Eratosthenes to return a sorted list of all primes up to a given integer n.

primes sieve loops
+10 pts 15m
Math & Number Theory easy

Prime Factorization

Return a sorted list of prime factors of a positive integer, including repeated factors.

prime math loops
+10 pts 15m
Dynamic Programming easy

Shortest Unsorted Continuous Subarray

Given an array of integers, return the length of the shortest contiguous subarray whose sorting makes the whole array sorted.

arrays sorting two-pointers
+10 pts 15m
Binary Search easy

Search Insert Position

Return the index where a target should be inserted into a sorted list to maintain order.

binary-search arrays searching
+10 pts 15m
Binary Search easy

Upper Bound Binary Search

Write a function that returns the index of the first element greater than a target in a sorted list.

binary-search arrays searching
+8 pts 12m
Binary Search easy

Find Indices of Target in Sorted List

Given a sorted list and a target, return the indices of its first and last occurrence, or [-1, -1] if absent.

binary-search sorted range
+10 pts 10m
Two Pointers & Sliding Window easy

Two Sum Sorted

Given a 1-indexed sorted array and a target, return the two indices that add up to the target.

two-pointers sorted-array array
+10 pts 15m
Two Pointers & Sliding Window easy

Squares of Sorted Array

Implement a function that returns a sorted list of squares for a given non-decreasing integer array.

two-pointers sorting array
+10 pts 15m

Showing 28 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

  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.