Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

triplets in python

#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the compareTriplets function below.
def compareTriplets(a, b):
    alice = 0
    bob = 0
    for i in range(3):
        if a[i] > b[i]:
            alice += 1
        elif b[i] > a[i]:
            bob += 1
    li =[alice,bob]
    return li

            


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('
')

    fptr.close()
Comment

PREVIOUS NEXT
Code Example
Python :: how to change theme of jupyter notebook 
Python :: python json change line 
Python :: seaborn python 
Python :: NumPy fliplr Syntax 
Python :: how i get url value in get_queryset function in drf 
Python :: how to specify a key to be as a break fomction python 
Python :: create a list of sequential numbers in python 
Python :: python all option 
Python :: range python start at 1 
Python :: run python script task scheduler 
Python :: hiw ti count the number of a certain value in python 
Python :: dataframe divided by rowsum 
Python :: add text to jpg python 
Python :: how to save string json to json object python 
Python :: how to loop through every character in a string 
Python :: python kubernetes client find pod with name 
Python :: pandas select only columns with na 
Python :: inline if statement python return 
Python :: Panda Python - Calculating what percentage of values are true and false out of total in boolean column 
Python :: how do i get auth user model dynamically in django? 
Python :: insert value in string python 
Python :: check if a string is palindrome or not using two pointer function in python 
Python :: how draw shell in python 
Python :: check if element is in list 
Python :: find in python 
Python :: df max count syntax 
Python :: python zip 
Python :: python selenium teardown class 
Python :: rank function in pandas 
Python :: case python 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =