Practice Arena

Python Coding Challenges

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

467 challenges 330 easy 120 medium 17 hard
Python Basics easy

Collatz steps

Count how many steps the Collatz sequence takes to reach 1 from n.

loops math
1
+10 pts 12m
Strings & Text easy

Replace multiple spaces

Implement a function that replaces every sequence of spaces with a single space.

strings whitespace normalization
+8 pts 10m
Data Structures & Algorithms easy

Shell Sort

Implement Shell sort, an in-place comparison sort that generalizes insertion sort, using a gap sequence that shrinks by half each pass.

sorting shell-sort in-place
+10 pts 15m
Iterators & Generators easy

Window Iterator

Implement a generator that yields consecutive windows of a given size from any iterable.

generators yield sliding-window
+8 pts 12m
Iterators & Generators easy

Pairwise Sequence Pairs

Write a generator function pairwise that yields each consecutive overlapping pair from any iterable as lists.

generators iterators pairs
+10 pts 15m
Iterators & Generators easy

Collatz Generator

Implement a generator function that yields the Collatz sequence starting from a given positive integer.

generators collatz sequence
+10 pts 10m
Math & Number Theory easy

Power set size

Compute the size of the power set of a given sequence.

math subsets counting
+8 pts 10m
Math & Number Theory easy

Lucas Sequence

Implement a function to compute the n-th Lucas number using iteration or recursion with memoization.

math sequence dynamic programming
+10 pts 15m
Trees & Binary Trees easy

Binary Search Tree Class

Build a BinarySearchTree class and a sequence runner that executes a list of operations.

binary-search-tree classes traversal
+10 pts 15m

Showing 9 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

  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.