Product of N terms of a given Geometric series | Function to calculate product of geometric series ; Return the final product with the above formula ; Given first term and common ratio ; Number of terms ; Function Call
def productOfGP ( a , r , n ) : NEW_LINE INDENT return pow ( a , n ) * pow ( r , n * ( n - 1 ) // 2 ) ; NEW_LINE DEDENT a = 1 ; r = 2 ; NEW_LINE N = 4 ; NEW_LINE print ( productOfGP ( a , r , N ) ) ; NEW_LINE