Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

467 challenges 330 easy 120 medium 17 hard
Lists & Arrays easy

Running Product of Integers

Given a list of integers, return a new list where each element at index i is the product of all elements from index 0 to i.

prefix product lists
+10 pts 10m
Lists & Arrays easy

Move Zeros to the End

Reorder a list in-place, pushing all zeros to the end while preserving the order of non-zero numbers.

lists in-place two-pointer
+10 pts 15m
Lists & Arrays easy

Chunk a list into n-sized parts

Write a function that divides a list into sublists of at most n elements.

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

Rotate Left by k

Implement a function that rotates a list left by k positions.

rotation lists slicing
+10 pts 15m
Lists & Arrays easy

Interleave Two Lists

Write a function that interleaves two lists element by element, preserving order.

lists merge indexing
+10 pts 10m
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 medium

Partition around a pivot value

Implement an in-place partition of a list around a given pivot value, returning the boundary index.

lists partition two-pointer
+20 pts 20m
Lists & Arrays easy

Insert into a Sorted List

Implement a function that inserts a value into a sorted list at the correct position using binary search.

lists binary-search insertion
+10 pts 10m
Lists & Arrays easy

Average excluding min and max

Return the average of a list after discarding the lowest and highest elements, handling edge cases.

lists statistics sorting
+7 pts 10m
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

Longest Run of Equal Values

Compute the length of the longest run (consecutive block) of equal elements in a list.

lists consecutive run-length
+8 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

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 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

Showing 21 challenges · Lists & Arrays

Lists & Arrays — Python coding challenges

What you will find here

This page lists lists & arrays challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.

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.