Practice Arena

Python Coding Challenges

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

925 challenges 556 easy 323 medium 46 hard
Python Basics easy

Count Leading Zeros

Write a function that returns the number of leading zeros in a list of integers.

lists iteration counting
+8 pts 8m
Python Basics easy

Cumulative Sum Vectorized

Implement a function that returns the cumulative sum of a list of numbers.

lists cumulative sum
+10 pts 10m
Lists & Arrays easy

Running Maximum

Implement a function that returns a list where each element is the largest value seen so far.

lists cumulative maximum
+10 pts 15m
Lists & Arrays easy

Difference of Consecutive Elements

Given a list of numbers, return a new list where each element is the difference between consecutive elements.

list iteration math
+8 pts 10m
Iterators & Generators easy

Range-like generator

Implement a custom generator that yields numbers like Python's range but with flexible bounds.

generator yield range
+8 pts 12m
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
Iterators & Generators easy

Digit Expansion Generator

Create a generator that lazily yields each decimal digit of a non-negative integer from most significant to least significant.

generators yield digits
+8 pts 10m
Iterators & Generators easy

Zip Longest Fill

Create an iterator that yields lists from multiple iterables, padding with a fill value when lengths differ.

generators zip iteration
+8 pts 12m
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
Bit Manipulation easy

Subset XOR sum

Given a list of integers, compute the bitwise XOR of each non-empty subset and return the sum of those XOR totals.

xor bitwise subsets
+8 pts 10m

Showing 1–10 of 10 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

  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.