Python Program to print N number of geometric terms


a =int(input(" Enter First Number of an G.P Series: : "))

n = int(input(" Enter the Total Numbers in this G.P Series: : "))

r = int(input("Please Enter the Common Ratio : "))


total = 0

value = a

print("\nG.P Series :", end = " ")

for i in range(n):

    print("%d " %value, end = " ")

    total = total + value

    value = value * r

print("\nThe Sum of Geometric Progression Series = " , total)


Comments

Some popular posts

Python Program that computes the net amount of a bank account based a transaction log from console input.