Ratio of mth and nth terms of an A . P . with given ratio of sums | function to calculate ratio of mth and nth term ; ratio will be tm / tn = ( 2 * m - 1 ) / ( 2 * n - 1 ) ; Driver code
def CalculateRatio ( m , n ) : NEW_LINE INDENT return ( 2 * m - 1 ) / ( 2 * n - 1 ) ; NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT m = 6 ; NEW_LINE n = 2 ; NEW_LINE print ( float ( CalculateRatio ( m , n ) ) ) ; NEW_LINE DEDENT