Practice · Python

Practice List Mutation & Methods

Grow and shrink lists with append/insert/pop/remove and sort/reverse, understanding these mutate in place.

List Mutation & Methodswarming python…

Filter and sort game scores

Write a function process_scores(scores) that receives a list of integer game scores. It should return a new list containing only the non‑negative scores, sorted in ascending order. Do not modify the original list.

Examples:

process_scores([10, -5, 3, -2, 7])  # returns [3, 7, 10]
process_scores([])                 # returns []
Press Run to see output, or Check to grade against the tests.

Want a whole course built around list mutation & methods?

Start my path — free

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