Disjoint Set Check
Check if two lists are disjoint by verifying they have no common elements.
Subset of another set
Write a function that checks if every element of one set is contained in another.
Frequency sort descending
Write a function that sorts a list by frequency descending while preserving original order for ties.
Count Pairs with Sum
Implement a function that counts the number of distinct pairs in a list summing to a target.
Hash map merge
Write a function that merges two dictionaries recursively, combining values and preserving structure.
Ransom Note Builder
Given two strings, determine if the ransom note can be formed from the words in the magazine.
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.
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.
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.
Pivot sales by product
Write a function that pivots sales records into a dictionary keyed by product with monthly totals.
Memoize decorator
Implement a @memoize decorator that caches results of a function.
Function composition
Return a function that applies f after g: compose(f, g)(x) == f(g(x)).
Curry a function
Auto-curry any multi-argument function so it returns partial applications until fully saturated.
Bind First Argument
Implement bind_first_arg, a decorator that fixes the first argument of any function.
Stack class
Implement a Stack class with push, pop, peek, is_empty, and size.
Linked list reversal
Implement a singly linked list and a function to reverse it in place.
Matrix addition operator
Implement a Matrix class that supports + and * operators.
Event emitter basics
Implement an EventEmitter class with subscribe/emit/unsubscribe functionality.
Rectangle class
Implement a Rectangle class with properties, methods, and special methods for basic geometry and comparison.
Complex Number Class
Implement a Complex class supporting addition, subtraction, multiplication, division, equality, and string formatting.
Queue class (list-based)
Implement a Queue class with enqueue, dequeue, peek, is_empty, and is_full methods using a list.
Comparable mixin
Create a Comparable mixin that auto-generates all rich comparison operators from a single __lt__ method.
Class Method Factory
Create a class method factory that dynamically adds methods to a class based on a mapping of names to behaviors.
Abstract Base Class
Create an abstract Shape class and implement Rectangle and Circle subclasses with area and perimeter.
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
- 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.