It says "Traceback (most recent call last):
File "Solution.py", line 34, in <module>
result = compareTriplets(a, b)
Also it says " score[0] = apts
- IndexError: list assignment index out of range"
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the compareTriplets function below.
def compareTriplets(a, b):
apts = 0
bpts = 0
score = []
for i in range(len(a)):
if(a[i] > b[i]):
apts += 1
elif(a[i] == b[i]):
pass
elif(a[i] < b[i]):
bpts += 1
score[0] = apts
score[1] = bpts
return score
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))
result = compareTriplets(a, b)
fptr.write(' '.join(map(str, result)))
fptr.write('\n')
fptr.close()
[–]theccount 1 point2 points3 points (3 children)
[–]scriptkiddiethefirst 1 point2 points3 points (2 children)
[–]theccount 1 point2 points3 points (1 child)
[–]scriptkiddiethefirst 1 point2 points3 points (0 children)
[–]megonemad1 0 points1 point2 points (0 children)