Concentration of juice after mixing n glasses in equal proportion | Function to return the concentration of the resultant mixture ; Driver code
def mixtureConcentration ( n , p ) : NEW_LINE INDENT res = 0 ; NEW_LINE for i in range ( n ) : NEW_LINE INDENT res += p [ i ] ; NEW_LINE DEDENT res /= n ; NEW_LINE return res ; NEW_LINE DEDENT arr = [ 0 , 20 , 20 ] ; NEW_LINE n = len ( arr ) ; NEW_LINE print ( round ( mixtureConcentration ( n , arr ) , 4 ) ) ; NEW_LINE