Skip to content

Lists · routine

Keep the positives

Write only_positive(nums) that returns a new list holding just the numbers greater than 0, in their original order.

Leave the list you were given exactly as it was — whoever called you may still need it.

Run adds print(data) after your code, to try it.

Stuck on the idea rather than the code? The Lists lesson walks through it.