Class-based decorator with call validation
Build a class-based decorator that validates a single argument's type and logs successful invocation.
Safe Integer from String
Implement safe_int that converts a string to an integer, returning a default value on any failure, with support for an optional base.
Divide with zero check
Write a function that safely divides two numbers, catching division by zero.
Multiline anchor match
Extract lines beginning with a plain-text prefix from multiline strings using Python's re module.
Match Balanced Parentheses with Regex
Write a function that uses regular expressions to determine if parentheses are balanced and properly nested.
Clamp and round to nearest ten
Clamp a number between given bounds and round the result to the nearest ten with halves away from zero.
Lucas Sequence
Implement a function to compute the n-th Lucas number using iteration or recursion with memoization.
Multiply without multiply
Write a function that multiplies two integers using only addition, subtraction, and bit shifts — no * operator.
Chinese Remainder Theorem
Solve a system of congruences with pairwise coprime moduli using the Chinese Remainder Theorem.
Stars and Bars Count
Implement stars_and_bars_count(n, k) which returns the number of ways to put n identical items into k distinct bins, with bins allowed to be empty.
Missing Number XOR
Given a list of n distinct numbers from 0 to n with one missing, use XOR to find and return the missing number.
Isolate Rightmost Set Bit
Given an integer, return a number with only its rightmost set bit set.
Add without plus
Implement a function that adds two integers using only bitwise operations, no arithmetic plus or minus.
Clear Rightmost Set Bit
Write a function clear_rightmost_set_bit that accepts a non-negative integer and returns the integer with its rightmost set bit cleared.
House Robber
Given a list of house values, return the maximum sum you can rob without robbing two adjacent houses.
Range Sum BST
Return the sum of all node values in a BST that lie within a given inclusive range [low, high].
Cycle Detection in a Directed Graph
Use DFS with a recursion stack to detect cycles in a directed graph.
Wildcard Match (Simple)
Write a function that checks whether a string matches a pattern with '*' and '?' wildcards.
Maximize units on truck
Given box types with count and units per box, maximize total units loaded onto a truck.
Longest Substring Without Repeating Characters
Implement a function that returns the length of the longest substring without repeating characters.
Container With Most Water
Compute the maximum area between two vertical lines in an array of heights.
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.
Reverse a linked list copy
Return a new list with node values in reverse order without mutating the input.
Showing 73–96 of 110 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
- 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.