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
Math & Number Theory easy

Dot Product of Vectors

Implement a function that returns the dot product of two numeric vectors.

math lists dot-product
+10 pts 10m
Math & Number Theory easy

Modular Inverse

Implement a function that returns the modular inverse of a modulo m, or -1 if it does not exist.

modular-arithmetic euclid math
+10 pts 15m
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 easy

Deficient Number Check

Write is_deficient(n) that returns True if the sum of proper divisors is less than n.

math number-theory divisors
+8 pts 8m
Math & Number Theory easy

Kaprekar number check

Check whether a given non-negative integer is a Kaprekar number in base 10.

math number-theory integer-properties
+10 pts 15m
Math & Number Theory easy

Stars and Bars Count

Implement stars_and_bars_count(n, k) which returns the number of ways to put n identical items into k distinct bins, with bins allowed to be empty.

combinatorics math combinations
+10 pts 15m
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
Math & Number Theory easy

Z score normalization

Compute the z-scores for a list of numbers using the population standard deviation.

statistics math standard-deviation
+8 pts 10m
Bit Manipulation easy

Missing Number XOR

Given a list of n distinct numbers from 0 to n with one missing, use XOR to find and return the missing number.

xor bitwise arrays
+10 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
Dynamic Programming easy

Derangement count

Implement a function to count derangements of n items using the classic recurrence.

dynamic-programming combinatorics recursion
+10 pts 15m
Dynamic Programming easy

Tiling dominoes count

Given a 2 x n board, count the distinct tilings using 2 x 1 dominoes.

dynamic-programming fibonacci counting
+10 pts 15m
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
Datetime & Time Calculations easy

Days in month

Write a function that returns the number of days in a given month and year, correctly handling leap years.

datetime calendar leap-year
+8 pts 10m

Showing 49–69 of 69 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.