All MicroEvals
Complete the following Python function: ```python def pairs...
Create MicroEval
Header image for Complete the following Python function:

```python
def pairs...

Complete the following Python function: ```python def pairs...

Prompt

Complete the following Python function: ```python def pairs_sum_to_zero(l): """ pairs_sum_to_zero takes a list of integers as an input. it returns True if there are two distinct elements in the list that sum to zero, and False otherwise. >>> pairs_sum_to_zero([1, 3, 5, 0]) False >>> pairs_sum_to_zero([1, 3, -2, 1]) False >>> pairs_sum_to_zero([1, 2, 3, 7]) False >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7]) True >>> pairs_sum_to_zero([1]) False """ ```

Answer guidance

Canonical solution (function body): for i, l1 in enumerate(l): for j in range(i + 1, len(l)): if l1 + l[j] == 0: return True return False

Drag to resize
Drag to resize
Drag to resize