Practice · Python

Practice Lists: Create & Index

Create list literals, access and update elements by index, and reason about list length.

Lists: Create & Indexwarming python…

Filter Mission Distances

You are preparing a list of interplanetary mission distances (in millions of kilometers). Write a function filter_distances(distances, min_distance) that returns a new list containing only the distances that are strictly greater than min_distance. Preserve the original order.

Examples

filter_distances([120, 250, 90, 300], 200)  # returns [250, 300]
filter_distances([], 50)                    # returns []
Press Run to see output, or Check to grade against the tests.

Want a whole course built around lists: create & index?

Start my path — free

Adaptive practice, streaks, projects with real code review. Free tier gates AI help, never content.

Practice Python: Lists: Create & Index — CodeArcade