a1 = 3
d = 3
n = 3

Sn = (n/2) * (2*a1 + (n-1)*d)

print("The sum of the first", n, "terms of the arithmetic sequence with a1 =", a1, "and d =", d, "is:", Sn)

What is the output of the following python program

Posted on by