a = 3
r = 3
n = 3

sequence = [a * r**i for i in range(n)]

print("Geometric progression with first term {0} and common ratio {1}:".format(a, r))
print(sequence)

What is the output of the following program

Posted on by