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
Heaps & Priority Queues medium

Sliding Window Maximum using Heap

Given an array of integers and a window size k, return an array of maximums for each contiguous subarray of length k.

heap sliding-window deque
+20 pts 20m
Matrix & 2D Arrays medium

Shift 2D Grid

Implement a function to shift a 2D grid right by k positions, flattening the grid and wrapping elements.

grid list modulo
+20 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

Flatten matrix to vector

Read rows left-to-right, top-to-bottom.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

Square each element

Return element-wise squares.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

Absolute value per element

Return element-wise absolute values.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

Keep positive elements

Return values strictly greater than zero.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

Prefix sum vector

Return running totals for each prefix of the vector.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

Element-wise multiply

Multiply corresponding elements.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

Count non-zero entries

Count elements not equal to zero.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

Reverse vector order

Return elements in opposite order.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

Transpose a matrix

Swap rows and columns for a rectangular matrix.

vectors arrays numpy-style
+22 pts 20m
Numpy & Vectorized Computing medium

L2 norm of vector

Return Euclidean length.

vectors arrays numpy-style
+22 pts 20m

Showing 73–85 of 85 challenges · medium

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.