Limit and Offset Query
Write a function that returns a page from a dataset given limit and offset.
Online Stock Span
Implement StockSpanner.next(price) that returns the maximum number of consecutive days (including today) with price <= current price.
Index Creation Query
Create an in-memory SQLite database, execute CREATE INDEX statements, and return the resulting index metadata rows.
Second highest salary
Given an employees table, write a SQL query that returns the second highest distinct salary, or NULL if it doesn't exist.
Nth Highest Salary
Write a Python function using SQLite to return the Nth highest distinct salary from an employee table.
Customers Never Order
Given Customers and Orders tables, return the names of customers with no orders, sorted alphabetically, or None if all have ordered.
Cumulative Sum SQL
Write a SQL query to compute cumulative sales totals per product ordered by sale date.
Showing 7 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.