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 medium

Basic Calculator

Implement a function that evaluates a simple arithmetic expression with +, -, *, / and parentheses.

calculator parsing math
+20 pts 25m
Strings & Text medium

Zigzag string conversion

Encode a string in zigzag order across numRows rows, then read row by row.

strings math
+22 pts 20m
Lists & Arrays medium

Product of All Except Zeros Handling

Given a list of integers, return a list where each element is the product of all other elements, handling zeros correctly.

product arrays zero-handling
+20 pts 25m
Lists & Arrays medium

Two Missing Numbers

Given a list of n-2 unique integers from 1 to n, find the two missing numbers efficiently.

missing-numbers arrays math
+25 pts 25m
Advanced Python medium

2D Vector dataclass

Implement a Vector2D dataclass with +, -, scalar *, dot product, and magnitude.

dataclass OOP math
1
+20 pts 18m
Math & Number Theory medium

Zeller Congruence Weekday

Implement a function that returns the weekday name for a given date using Zeller's congruence.

math modular-arithmetic date
+20 pts 20m
Math & Number Theory medium

Extended Euclidean Algorithm

Implement the extended Euclidean algorithm to return (gcd, x, y) such that ax + by = gcd(a, b).

gcd extended-euclidean number-theory
+30 pts 25m
Math & Number Theory medium

Multinomial coefficient

Write a function to compute the multinomial coefficient efficiently for given nonnegative counts.

combinatorics math division
+20 pts 20m
Math & Number Theory medium

Correlation Coefficient

Write a pure-Python function that computes the Pearson correlation coefficient between two lists of numbers.

statistics math arrays
+15 pts 15m
Dynamic Programming medium

Bell number

Implement a function to compute the Bell number B(n) using dynamic programming.

dp combinatorics math
+25 pts 25m
Dynamic Programming medium

Perfect Squares Sum

Given a positive integer n, return the least number of perfect squares (e.g., 1, 4, 9, 16, ...) that sum to n.

dynamic-programming math optimization
+25 pts 25m
Dynamic Programming medium

Integer Break Product

Given a positive integer n, break it into at least two positive integers that sum to n and maximize their product.

integer-break dynamic-programming max-product
+25 pts 30m
Dynamic Programming medium

Ugly Number II

Given an integer n, return the nth ugly number using an efficient dynamic programming approach.

dynamic programming math pointers
+25 pts 25m
Binary Search medium

Kth Missing Positive

Given a strictly increasing array and an integer k, return the k-th positive integer that is missing from the array.

binary search arrays mathematics
+20 pts 25m
Binary Search medium

Minimum Speed to Arrive on Time

Given commute distances and a time limit, compute the minimum integer speed so you arrive on time.

binary-search simulation math
+25 pts 30m
Binary Search medium

Nth Magical Number

Given three integers n, a, b, return the nth positive integer that is divisible by either a or b.

binary-search math counting
+25 pts 25m
Heaps & Priority Queues medium

Maximum Average Pass Ratio

Given class pass/total counts and extra students, maximize the average pass ratio by assigning extra students optimally.

heap priority-queue greedy
+25 pts 25m

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