Program to print GP ( Geometric Progression ) | function to print GP ; starting number ; Common ratio ; N th term to be find
def printGP ( a , r , n ) : NEW_LINE INDENT for i in range ( 0 , n ) : NEW_LINE INDENT curr_term = a * pow ( r , i ) NEW_LINE print ( curr_term , end = " ▁ " ) NEW_LINE DEDENT DEDENT a = 2 NEW_LINE r = 3 NEW_LINE n = 5 NEW_LINE printGP ( a , r , n ) NEW_LINE