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.

Python Program which will find all such numbers between 1000 and 3000 (both included) such that each digit of the number is an even number.The numbers obtained should be printed in a comma-separated sequence on a single line