python3: add compare-the-triplets

master
lub 6 years ago
parent f7275ab22c
commit b9007b263a

@ -0,0 +1,33 @@
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the compareTriplets function below.
def compareTriplets(a, b):
points = {'a':0,'b':0}
for i in range(3):
if(a[i] > b[i]):
points['a'] += 1
elif(a[i] < b[i]):
points['b'] += 1
return points.values()
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()
Loading…
Cancel
Save