Collatz steps
Count how many steps the Collatz sequence takes to reach 1 from n.
Factorial (iterative)
Compute n! iteratively without recursion.
Power of two?
Return True if n is an exact power of 2.
GCD via Euclid
Compute the greatest common divisor of two positive integers.
Prime checker
Return True if n is a prime number.
Compound interest
Return the future balance after compound interest, rounded to two decimals.
Absolute Difference of Two Integers
Compute the absolute difference between two integers, regardless of order.
Sum from 1 to n
Write a function that returns the sum of all integers from 1 to n (inclusive).
Circle Circumference Calculator
Implement a function that computes the circumference of a circle from its radius using the formula 2πr.
Digit Count
Count the number of digits in an integer using arithmetic, without string conversion.
Find Missing Number
Given a list of n distinct integers from 0..n with one missing, return the missing number.
Hexagonal Number
Write a function to check if a positive integer is a hexagonal number.
Count trailing zeros
Write a function that counts the number of trailing zeros in the decimal representation of a positive integer.
Basic Calculator
Implement a function that evaluates a simple arithmetic expression with +, -, *, / and parentheses.
Array mean and std
Implement the function array_stats that returns the mean and population standard deviation of a list of numbers.
Percentile Calculation
Given a list of numbers and a target value, return the percentile rank of that value in the list.
Euclidean Distance Matrix
Write a function to compute the Euclidean distance between every pair of points from two lists.
Cosine Similarity of Vectors
Compute the cosine similarity between two equal-length numeric vectors using pure Python.
Zigzag string conversion
Encode a string in zigzag order across numRows rows, then read row by row.
Find Missing Number 1 to n
Given a list containing n-1 distinct integers from 1 to n, find the missing number without using extra space.
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.
Difference of Consecutive Elements
Given a list of numbers, return a new list where each element is the difference between consecutive elements.
Two Missing Numbers
Given a list of n-2 unique integers from 1 to n, find the two missing numbers efficiently.
Linear Interpolation Array
Given an array with some None values, replace them by linear interpolation between the nearest known values.
Showing 1–24 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
- Pick a category — basics, algorithms, strings, and more
- Open a challenge, read the statement, and edit the starter code
- 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.