Collatz steps
Count how many steps the Collatz sequence takes to reach 1 from n.
Replace multiple spaces
Implement a function that replaces every sequence of spaces with a single space.
Longest increasing subsequence
Return the length of the longest strictly increasing subsequence.
Longest Consecutive Sequence
Given an unsorted list of integers, find the length of the longest consecutive elements sequence in O(n) time.
Shell Sort
Implement Shell sort, an in-place comparison sort that generalizes insertion sort, using a gap sequence that shrinks by half each pass.
Window Iterator
Implement a generator that yields consecutive windows of a given size from any iterable.
Pairwise Sequence Pairs
Write a generator function pairwise that yields each consecutive overlapping pair from any iterable as lists.
Collatz Generator
Implement a generator function that yields the Collatz sequence starting from a given positive integer.
Power set size
Compute the size of the power set of a given sequence.
Lucas Sequence
Implement a function to compute the n-th Lucas number using iteration or recursion with memoization.
Longest Common Subsequence
Given two strings, compute the length of the longest subsequence common to both.
Longest Palindromic Subsequence
Compute the length of the longest palindromic subsequence in a given string.
Longest Arithmetic Subsequence
Given a list of integers, return the length of the longest arithmetic subsequence (constant difference) within it.
Binary Search Tree Class
Build a BinarySearchTree class and a sequence runner that executes a list of operations.
Showing 14 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.