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
Lists & Arrays easy

Running Maximum

Implement a function that returns a list where each element is the largest value seen so far.

lists cumulative maximum
+10 pts 15m
Lists & Arrays easy

Zip lists into pairs

Write a function that takes two lists and returns a list of two-element sublists pairing elements by index up to the shortest length.

zip lists pairs
+7 pts 10m
Lists & Arrays easy

Middle Element of an Odd-Length List

Implement a function that returns the middle element of an odd-length list.

lists indexing basic
+5 pts 5m
Lists & Arrays easy

Is Subset of Another List

Write a function that returns True if every element in a given list exists in another list, ignoring duplicates.

subset membership lists
+8 pts 12m
Lists & Arrays easy

Unzip pairs into two lists

Write a function that takes a list of pairs and returns two separate lists: first elements and second elements.

zip unpacking lists
+10 pts 10m
Lists & Arrays easy

Generate a Multiplication Table

Build a function that returns an n x n multiplication table as a list of lists.

nested-loops list-comprehension matrix
+10 pts 10m
Lists & Arrays easy

Majority Element Finder

Implement a function that returns the majority element in a list, which appears more than half the time.

majority frequency arrays
+10 pts 15m
Lists & Arrays easy

Union of Two Lists

Implement a function that combines two lists and returns only unique elements.

union list set
+10 pts 15m
Lists & Arrays easy

Difference of Two Lists

Write a function that returns items in list a that are not in list b, preserving order and duplicates.

lists difference counting
+8 pts 10m
Lists & Arrays easy

Last occurrence index

Implement a function that returns the last index of a given value in a list, or -1 if the value is not present.

lists indexing search
+10 pts 10m
Lists & Arrays easy

Cartesian Product Pairs

Create a function that returns the Cartesian product of two lists as a sorted list of lists.

lists tuples sorting
+8 pts 12m
Lists & Arrays easy

Reorder list halves

Implement reorder_list(nums) that returns the first half followed by the reversed second half.

lists slicing reversal
+8 pts 10m
Lists & Arrays easy

Insertion Sort

Implement insertion sort that sorts a list in-place and returns the same list.

sorting in-place algorithms
+8 pts 12m
Lists & Arrays easy

Running Total Window

Implement a function that returns a list of running totals, resetting to zero after each positive sum.

running-total sliding-window arrays
+8 pts 10m
Lists & Arrays easy

Boolean Mask Filter

Write a function that filters a list using a boolean mask and returns the matching elements as a list.

mask filter list
+8 pts 10m
Dicts & Sets easy

Word to Index Map

Create a function that returns a dictionary mapping each unique word to the index of its first occurrence.

dictionary mapping indexing
+10 pts 10m
Dicts & Sets easy

Common Keys of Two Dictionaries

Implement a function that finds keys shared by two dictionaries and returns them sorted.

dict set sorting
+8 pts 10m
Dicts & Sets easy

Union of Many Sets

Implement a function that takes any number of sets and returns a sorted list of their union.

sets union flatten
+10 pts 10m
Dicts & Sets easy

Mode of a list via counting

Implement a function that returns the mode of a list, resolving ties by the element that appears first.

counting dictionaries mode
+10 pts 15m
Dicts & Sets easy

Revenue by Month

Write a function that groups a list of (date, amount) pairs by year-month and returns total revenue per month as a sorted dictionary.

dict aggregation sales
+8 pts 10m
Functions & Closures hard

Curry a function

Auto-curry any multi-argument function so it returns partial applications until fully saturated.

functional closures inspect
+35 pts 30m
OOP & Classes easy

Singleton Factory

Implement a factory class that returns a singleton instance per key.

oop singleton factory
+8 pts 10m
Data Structures & Algorithms easy

Index of peak element

Implement a function that returns the index of any peak element in a given integer array.

arrays search peak
+10 pts 15m
Data Structures & Algorithms medium

Find Peak Element

Implement a function that returns the index of any peak element in an integer array.

arrays search binary-search
+20 pts 25m

Showing 49–72 of 150 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.