arr = [5, 0, 1, -2, 7, -3, 12, -10, 2, 10] 
answer = 0

for i in range(len(arr)):
    for j in range(i+1,len(arr)):
        if arr[i] + arr[j] == 0:
            answer += 1
        
print(answer)
    

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: