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
Strings & Text medium

Longest common prefix

Find the longest common prefix among a list of strings.

strings zip
+18 pts 18m
Lists & Arrays medium

Product except self

Return an array where output[i] is the product of all elements except nums[i], without using division.

arrays prefix-sum
+25 pts 20m
Lists & Arrays easy

Running Product of Integers

Given a list of integers, return a new list where each element at index i is the product of all elements from index 0 to i.

prefix product lists
+10 pts 10m
Dicts & Sets medium

Subarray sum equals K

Count the number of contiguous subarrays whose sum equals k.

prefix-sum dict arrays
+28 pts 25m
Data Structures & Algorithms hard

Count of Range Sum

Count contiguous subarrays whose sum lies in a given inclusive range using an efficient divide-and-conquer algorithm.

prefix-sum merge-sort divide-conquer
+35 pts 40m
Data Structures & Algorithms medium

Trie Insert and Search

Implement a Trie and a scenario runner that executes insert/search/prefix operations.

trie insert search
+25 pts 25m
Regular Expressions easy

Multiline anchor match

Extract lines beginning with a plain-text prefix from multiline strings using Python's re module.

regex anchors multiline
+10 pts 15m
Greedy Algorithms hard

Patching Array

Given a sorted array of positive integers and a target n, find the minimum number of patches to make every number from 1 to n representable as a subset sum.

greedy arrays prefix-sums
+40 pts 30m
Two Pointers & Sliding Window easy

Best Time to Buy and Sell Stock

Given a list of daily stock prices, determine the maximum profit achievable by buying on one day and selling on a later day.

arrays sliding-window profit
+10 pts 15m
Linked Lists medium

Split list at index

Return prefix and suffix tuples at index k.

linked-list lists pointers
+22 pts 20m
Matrix & 2D Arrays medium

Matrix Block Sum

Given a 2D matrix and a block size, compute the sum of each block centered at every cell.

matrix prefix-sum 2d-array
+25 pts 25m
Numpy & Vectorized Computing medium

Prefix sum vector

Return running totals for each prefix of the vector.

vectors arrays numpy-style
+22 pts 20m

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