GCD via Euclid
Compute the greatest common divisor of two positive integers.
Absolute Difference of Two Integers
Compute the absolute difference between two integers, regardless of order.
Grade from Score
Write a function that maps a numeric score to its letter grade using standard grading thresholds.
Min of three numbers
Write a function that returns the minimum of three integers.
Integer division and remainder
Write a function that performs integer division and returns both quotient and remainder.
Sum numbers from 1 to n
Implement a function that computes the sum of all integers from 1 to n.
Seconds to Hours Minutes Seconds
Convert total seconds into a zero-padded HH:MM:SS format.
Digit count of an integer
Given an integer, return the number of digits it has, handling negatives and zero correctly.
Count Multiples in a Range
Given a start, end, and divisor, count how many integers in [start, end] are divisible by the divisor.
Sum from 1 to n
Write a function that returns the sum of all integers from 1 to n (inclusive).
Count Positives
Count the positive numbers in a list of integers.
Round to nearest ten
Write a function that rounds any integer to the nearest multiple of ten.
Modulo Remainder
Implement a function that returns the remainder of a divided by b without using the modulo operator.
Last Digit Extractor
Write a function that returns the last digit of a non-negative integer using the modulo operator.
Find Missing Number
Given a list of n distinct integers from 0..n with one missing, return the missing number.
Map, Filter, Reduce
Implement three functions using map, filter, and reduce to manipulate a list of integers.
Count trailing zeros
Write a function that counts the number of trailing zeros in the decimal representation of a positive integer.
Count Leading Zeros
Write a function that returns the number of leading zeros in a list of integers.
Find all numbers in text
Write a function that extracts all standalone integers from a text string using regular expressions.
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.
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.
Wave sort array
Given a list of integers, reorder it into a wave pattern where elements alternate down-up, and return the new list.
Counting Sort
Implement the counting sort algorithm to sort a list of non-negative integers in O(n + k) time.
Keys Sorted by Value Descending
Given a dictionary mapping strings to integers, return a list of keys sorted by value descending, and when values tie, alphabetically ascending.
Pascal Triangle Row
Given a non-negative integer n, return the nth row of Pascal's triangle as a list of integers.
Digit Expansion Generator
Create a generator that lazily yields each decimal digit of a non-negative integer from most significant to least significant.
Nth Triangular Number
Implement a function that returns the nth triangular number efficiently.
Euler Totient Function
Implement Euler's totient function φ(n) for positive integers.
Partition function
Write a function that returns the number of ways to write a positive integer as a sum of positive integers (order irrelevant).
Multiply without multiply
Write a function that multiplies two integers using only addition, subtraction, and bit shifts — no * operator.
Single Number XOR
Given a non-empty list of integers where every element appears twice except one, return the single number using XOR.
Gray Code Decode
Implement gray_decode(n) that converts an n-bit Gray code integer back to its standard binary value using XOR accumulation.
Add without plus
Implement a function that adds two integers using only bitwise operations, no arithmetic plus or minus.
Brian Kernighan count
Implement a function that counts set bits using Brian Kernighan's efficient algorithm.
Permutation Generator
Write a function that returns all permutations of a list of distinct integers.
Showing 35 challenges · easy
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.