Find the ratio of number of elements in two Arrays from their individual and combined average | Python3 program to Find the Ratio of number of Elements in two Arrays from their individual and combined Average ; function to find the ratio of number of array elements ; calculating GCD of them ; make neumarator and denominator coprime ; Driver Code
from math import gcd NEW_LINE def FindRatio ( a , b , c ) : NEW_LINE INDENT up = abs ( b - c ) NEW_LINE down = abs ( c - a ) NEW_LINE g = gcd ( up , down ) NEW_LINE up //= g NEW_LINE down //= g NEW_LINE print ( up , " : " , down ) NEW_LINE DEDENT a = 4 NEW_LINE b = 10 NEW_LINE c = 6 NEW_LINE FindRatio ( a , b , c ) NEW_LINE