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 easy

Palindromic Number Check

Write a function to check if a given integer is a palindrome.

numbers strings conditionals
+10 pts 10m
Python Basics easy

Hexagonal Number

Write a function to check if a positive integer is a hexagonal number.

math loops conditionals
+10 pts 15m
Python Basics easy

Count trailing zeros

Write a function that counts the number of trailing zeros in the decimal representation of a positive integer.

loops integers basics
+5 pts 5m
Python Basics easy

Count Leading Zeros

Write a function that returns the number of leading zeros in a list of integers.

lists iteration counting
+8 pts 8m
Python Basics easy

Convolve 1D signal

Implement a 1D convolution function with three modes using pure Python.

convolution arrays loops
+8 pts 12m
Python Basics easy

Guess Number Game

Simulate a number guessing game with attempts, feedback, and a win/lose result.

loops conditionals functions
+10 pts 15m
Python Basics easy

Remove Duplicates from Sorted Array

Given a sorted list, remove duplicates in-place and return the new length.

lists in-place two-pointers
+10 pts 15m
Python Basics medium

Longest Substring with K Repeating Characters

Return the length of the longest substring of a given string in which every character appears at least K times.

strings sliding-window substring
+18 pts 20m
Python Basics medium

Basic Calculator

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

calculator parsing math
+20 pts 25m
Python Basics easy

Copy deep vs shallow

Predict and write a function that returns a copied list and inspect whether nested modification affects the original.

copy nested mutation
+8 pts 10m
Python Basics easy

Take n Items

Given a list and a non-negative integer n, return a new list containing the first n elements.

slicing list basics
+8 pts 10m
Python Basics easy

Overlap two intervals

Given two closed intervals, return their overlap as a tuple or None if they do not overlap.

conditionals arithmetic intervals
+8 pts 10m
Python Basics easy

Condition Variable Waiter

Implement a deterministic simulation of a waiter whose tray has limited capacity and who becomes busy for a fixed time after each pickup.

simulation queue control-flow
+10 pts 15m
Python Basics easy

Parse environment variables

Write parse_env_vars that parses KEY=VALUE lines into a dict, converting booleans/numbers and ignoring comments.

strings parsing dictionaries
+8 pts 15m
Python Basics easy

Filter by Age

Filter a list of person dictionaries by age and return their names.

loops conditionals dictionaries
+8 pts 12m
Python Basics easy

Limit and Offset Query

Write a function that returns a page from a dataset given limit and offset.

pagination list slicing
+8 pts 10m
Python Basics easy

Insert New Row

Implement a function that inserts a new row into a 2D list at a specified index.

lists insert rows
+5 pts 5m
Python Basics easy

Rank Employees by Salary

Sort a list of employee dictionaries by salary descending, tie-break by name, and return ranked strings.

sorting dictionaries lists
+8 pts 10m
Python Basics easy

Array mean and std

Implement the function array_stats that returns the mean and population standard deviation of a list of numbers.

statistics mean std
+10 pts 15m
Python Basics easy

Broadcast Add Scalar

Add a scalar to every number in a 2D list and return a new 2D list without modifying the original.

nested-loops addition lists
+10 pts 15m
Python Basics easy

Fancy Index Select

Given a 2D matrix and a list of row indices, select those rows in order and return them as a new 2D list.

indexing lists matrix
+10 pts 10m
Python Basics easy

Reshape array dimensions

Implement a function that reshapes a 1D list into a 2D list with given dimensions.

reshape matrix lists
+8 pts 10m
Python Basics easy

Cumulative Sum Vectorized

Implement a function that returns the cumulative sum of a list of numbers.

lists cumulative sum
+10 pts 10m
Python Basics easy

Element-wise Clip

Implement a function that clips each element of a list to a specified range.

clipping lists conditionals
+8 pts 10m

Showing 73–96 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

  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.