GP Maker

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#Formula for geometric progression is a*r^(n-1)

#where a is the first term, r is the common ratio and n is the number of terms.
#Input values from user
a=int(input("Enter first value of your progression:\n"))
r=int(input("Enter thee commonn ratio of your progression:\n"))
n=int(input("Enter number values in of your progression:\n"))
#Calculating GP
print("The sequence is:")
for i in range(0,n):
k=r**i
gp=a*k
print(gp)

You might also like