Date: 18 July, 2023
Model: gpt-3.5-turbo
Temperature: 0.2
Passing runs: 10
Total runs: 10
Success rate: 100%
Tokens: 183
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
"""
The above is an incomplete Python code fragment. Return the complete and correct code with no additional text.
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
"""for i, l1 in enumerate(l):
for j in range(i + 1, len(l)):
if l1 + l[j] == 0:
return True
return False
METADATA = {}
def check(candidate):
assert candidate([1, 3, 5, 0]) == False
assert candidate([1, 3, -2, 1]) == False
assert candidate([1, 2, 3, 7]) == False
assert candidate([2, 4, -5, 3, 5, 7]) == True
assert candidate([1]) == False
assert candidate([-3, 9, -1, 3, 2, 30]) == True
assert candidate([-3, 9, -1, 3, 2, 31]) == True
assert candidate([-3, 9, -1, 4, 2, 30]) == False
assert candidate([-3, 9, -1, 4, 2, 31]) == False
Start time: 2023-07-18 17:22:07
Duration: 7.11s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:59
Duration: 7.51s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:52
Duration: 7.28s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:44
Duration: 7.74s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:37
Duration: 7.05s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:30
Duration: 6.83s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:23
Duration: 7.65s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:15
Duration: 7.2s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:08
Duration: 7.13s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False
Start time: 2023-07-18 17:21:01
Duration: 7.51s
Completion tokens: 191
Result: Pass
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
"""
for i in range(len(l)):
for j in range(i+1, len(l)):
if l[i] + l[j] == 0:
return True
return False