Files

13 lines
340 B
Python

# HumanEval/30
# Loki Mode Multi-Agent Solution
# Attempts: 1
# Passed: True
def get_positive(l: list):
"""Return only positive numbers in the list.
>>> get_positive([-1, 2, -4, 5, 6])
[2, 5, 6]
>>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])
[5, 3, 2, 3, 9, 123, 1]
"""
return [x for x in l if x > 0]