Practice Arena

Python Coding Challenges

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

925 challenges 556 easy 323 medium 46 hard
Dicts & Sets easy

Disjoint Set Check

Check if two lists are disjoint by verifying they have no common elements.

sets list membership
+10 pts 15m
Dicts & Sets easy

Subset of another set

Write a function that checks if every element of one set is contained in another.

sets subset membership
+10 pts 10m
Dicts & Sets easy

Frequency sort descending

Write a function that sorts a list by frequency descending while preserving original order for ties.

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

Count Pairs with Sum

Implement a function that counts the number of distinct pairs in a list summing to a target.

dictionary pair-counting hash-map
+10 pts 15m
Dicts & Sets medium

Hash map merge

Write a function that merges two dictionaries recursively, combining values and preserving structure.

dictionaries recursion merging
+15 pts 15m
Dicts & Sets easy

Ransom Note Builder

Given two strings, determine if the ransom note can be formed from the words in the magazine.

dictionary counting strings
+10 pts 15m
Dicts & Sets easy

Longest Harmonious Subsequence

Given a list of integers, find the length of the longest harmonious subsequence where the difference between maximum and minimum values is exactly 1.

hash-map counting subsequence
+10 pts 15m
Dicts & Sets easy

Group by Department

Implement a function that groups a list of employee dictionaries by department, returning a dictionary keyed by department with lists of employee dictionaries.

dicts loops grouping
+8 pts 10m
Dicts & Sets easy

Revenue by Month

Write a function that groups a list of (date, amount) pairs by year-month and returns total revenue per month as a sorted dictionary.

dict aggregation sales
+8 pts 10m
Dicts & Sets easy

Pivot sales by product

Write a function that pivots sales records into a dictionary keyed by product with monthly totals.

dicts grouping aggregation
+10 pts 15m
Functions & Closures medium

Memoize decorator

Implement a @memoize decorator that caches results of a function.

decorators closures caching
1
+25 pts 20m
Functions & Closures medium

Function composition

Return a function that applies f after g: compose(f, g)(x) == f(g(x)).

functional closures higher-order
+20 pts 18m
Functions & Closures hard

Curry a function

Auto-curry any multi-argument function so it returns partial applications until fully saturated.

functional closures inspect
+35 pts 30m
Functions & Closures easy

Bind First Argument

Implement bind_first_arg, a decorator that fixes the first argument of any function.

decorators closures functions
+10 pts 15m
OOP & Classes easy

Stack class

Implement a Stack class with push, pop, peek, is_empty, and size.

OOP stack data-structures
+12 pts 15m
OOP & Classes medium

Linked list reversal

Implement a singly linked list and a function to reverse it in place.

linked-list OOP pointers
+28 pts 25m
OOP & Classes medium

Matrix addition operator

Implement a Matrix class that supports + and * operators.

OOP dunder matrix
+22 pts 20m
OOP & Classes easy

Event emitter basics

Implement an EventEmitter class with subscribe/emit/unsubscribe functionality.

oop callbacks events
+10 pts 15m
OOP & Classes easy

Rectangle class

Implement a Rectangle class with properties, methods, and special methods for basic geometry and comparison.

classes magic-methods geometry
+10 pts 12m
OOP & Classes medium

Complex Number Class

Implement a Complex class supporting addition, subtraction, multiplication, division, equality, and string formatting.

classes magic-methods arithmetic
+20 pts 25m
OOP & Classes easy

Queue class (list-based)

Implement a Queue class with enqueue, dequeue, peek, is_empty, and is_full methods using a list.

queue oop list
+10 pts 15m
OOP & Classes medium

Comparable mixin

Create a Comparable mixin that auto-generates all rich comparison operators from a single __lt__ method.

oop mixin dunder-methods
+20 pts 20m
OOP & Classes medium

Class Method Factory

Create a class method factory that dynamically adds methods to a class based on a mapping of names to behaviors.

oop metaprogramming factory
+20 pts 25m
OOP & Classes easy

Abstract Base Class

Create an abstract Shape class and implement Rectangle and Circle subclasses with area and perimeter.

abc abstract oop
+10 pts 15m

Showing 313–336 of 925 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.