Validated descriptor
Implement a TypedField descriptor that raises TypeError if the value is not of the expected type.
Async Context Manager Lifecycle
Build an async context manager class that tracks acquisition and ensures cleanup.
Default Argument Trap
Implement a function that safely accumulates items without the classic mutable default argument bug.
Metaclass Registry
Implement a metaclass that automatically registers every subclass in a class-level registry.
Descriptor Property
Create a descriptor class that ensures attribute values are positive integers.
Custom iterator class
Implement a custom iterator class that repeatedly yields elements from a list up to a given number of times.
Flatten Nested List Iterator
Implement a class that iterates over all integers in a nested list structure in depth-first order.
Iterator protocol class
Implement a class that follows the iterator protocol and yields squared numbers up to a given limit.
Context Manager Class
Implement a context manager class that measures execution time and sets duration, with None if an exception occurred.
File Open Context Manager
Create a class that acts as a context manager for opening a virtual file in memory.
Lock Context Manager
Implement a Lock class with acquire/release and context manager support.
Class-based decorator with call validation
Build a class-based decorator that validates a single argument's type and logs successful invocation.
Validation result object
Implement a ValidationResult class that tracks validation errors and can report validity.
Lookahead Validation
Write a regex-based function to check if a password meets length and character class requirements.
Levenshtein Distance
Implement the classic Levenshtein distance algorithm to measure string similarity.
Edit Distance (Levenshtein Distance)
Implement the classic edit distance algorithm to find the minimum number of single-character edits required to transform one string into another.
0/1 Knapsack
Implement the classic 0/1 Knapsack dynamic programming solution to maximize value under a weight capacity.
Egg Drop Puzzle
Given k eggs and n floors, compute the minimum number of attempts required in the worst case to find the highest safe floor.
Derangement count
Implement a function to count derangements of n items using the classic recurrence.
Binary Search Tree Class
Build a BinarySearchTree class and a sequence runner that executes a list of operations.
Keys and Rooms
A classic graph traversal challenge: check if all rooms are reachable from room 0 using keys found in visited rooms.
Max Stack Design
Implement a MaxStack class with push, pop, top, and get_max operations.
Min Heap Class
Build a MinHeap class with push, pop, peek, and size methods that maintain a valid min-heap.
Maximum Average Pass Ratio
Given class pass/total counts and extra students, maximize the average pass ratio by assigning extra students optimally.
Showing 25–48 of 48 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
- 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.