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

Intersection of Two Lists

Given two lists, return a sorted list of unique elements that appear in both lists.

intersection sorting unique
+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

Chunk list into groups

Implement a function that splits a list into sublists of a given size.

list slicing chunking
+10 pts 10m
Lists & Arrays easy

Zip Two Lists

Write a function that pairs elements from two lists by index, stopping at the shorter list.

zip lists pairs
+8 pts 10m
Lists & Arrays medium

Partition Array

Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.

arrays partition contiguous
+25 pts 25m
Lists & Arrays easy

Rearrange Positives and Negatives

Write a function that rearranges a list in-place so all negative numbers come before non-negative numbers.

in-place two-pointers partition
+10 pts 15m
Lists & Arrays easy

Wave sort array

Given a list of integers, reorder it into a wave pattern where elements alternate down-up, and return the new list.

sorting swap rearrangement
+10 pts 15m
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

Counting Sort

Implement the counting sort algorithm to sort a list of non-negative integers in O(n + k) time.

sorting counting arrays
+10 pts 15m
Lists & Arrays medium

Two Missing Numbers

Given a list of n-2 unique integers from 1 to n, find the two missing numbers efficiently.

missing-numbers arrays math
+25 pts 25m
Lists & Arrays medium

Three Missing Numbers

Find the three missing numbers from a shuffled list containing all but three integers from 1 to n.

arrays sets missing
+15 pts 15m
Lists & Arrays easy

Image channel swap

Implement a function that swaps the red and blue channels of an RGB image.

lists comprehensions rgb
+10 pts 15m
Lists & Arrays easy

Pad Array Edges

Write a function that pads a list with zeros on both ends.

lists slicing padding
+10 pts 10m
Lists & Arrays medium

Count Smaller Numbers

Given an integer list, return for each position how many later elements are smaller than it.

arrays counting merge-sort
+20 pts 20m
Lists & Arrays easy

Sort array by parity

Given a list of integers, return a new list with all evens first and odds last, preserving original relative order.

sorting arrays two-pointers
+10 pts 15m
Lists & Arrays easy

Count Adjacent Pairs

Given a list of integers and a target, count adjacent pairs whose sum equals the target.

pairs sum adjacent
+10 pts 15m
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

Sort List Merge Sort

Write a function that sorts a list of integers using the merge sort algorithm.

merge sort sorting recursion
+10 pts 15m
Lists & Arrays easy

Rotate List Right by k

Implement a function that rotates a list to the right by k positions.

lists rotation modulo
+8 pts 10m
Lists & Arrays easy

Convert Binary Number List

Given a list of bits (0s and 1s) in most-significant-first order, return the equivalent integer value.

binary lists conversion
+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

Intersection two lists length

Return the number of distinct elements that appear in both input lists.

lists sets intersection
+8 pts 10m

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