Sum of divisors
Given an integer n, return the sum of all its positive divisors.
Perfect Number Check
Write a function that returns True if a number is perfect, i.e., equal to the sum of its proper divisors.
Abundant Number Check
Implement a function to check whether a given integer is abundant: sum of proper divisors exceeds the number.
Amicable Numbers Check
Write a function that checks if two numbers are an amicable pair by comparing sums of proper divisors.
Armstrong Number Check
Implement a function that checks if a given integer is an Armstrong number.
Happy number check
Implement a function that returns True if a number is happy, False otherwise.
Harshad Number Check
Write a function that checks if a number is a Harshad (or Niven) number.
Smith Number Check
Write a function to check if a number is a Smith number by comparing digit sums of the number and its prime factorization.
Triangular Number
Implement a function that returns the nth triangular number using the closed-form formula.
Pentagonal Number
Given a positive integer n, return the nth pentagonal number using the formula P(n) = n(3n - 1)/2.
Lucas Sequence
Implement a function to compute the n-th Lucas number using iteration or recursion with memoization.
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.
Integer Square Root
Implement integer_sqrt(n) that returns the largest integer whose square is ≤ n.
Zeller Congruence Weekday
Implement a function that returns the weekday name for a given date using Zeller's congruence.
Dot Product of Vectors
Implement a function that returns the dot product of two numeric vectors.
Modular Inverse
Implement a function that returns the modular inverse of a modulo m, or -1 if it does not exist.
Chinese Remainder Theorem
Solve a system of congruences with pairwise coprime moduli using the Chinese Remainder Theorem.
Extended Euclidean Algorithm
Implement the extended Euclidean algorithm to return (gcd, x, y) such that ax + by = gcd(a, b).
Deficient Number Check
Write is_deficient(n) that returns True if the sum of proper divisors is less than n.
Kaprekar number check
Check whether a given non-negative integer is a Kaprekar number in base 10.
Polynomial Fit Coefficients
Implement a function that returns the coefficients of the best-fit quadratic polynomial for given points.
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.
Multinomial coefficient
Write a function to compute the multinomial coefficient efficiently for given nonnegative counts.
Showing 505–528 of 925 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.