Computer Science, asked by CHUTlYA, 5 hours ago

Write a python program that generate four terms of an AP by providing initial and steps values to a function that returns the first four terms of the series.

No spam pls​

Answers

Answered by DivyaRaval
3

Answer:

def retSeries(init, step ):

return init, init + step, init + 2 * step, init + 3 * step

ini = int(input("Enter initial value of the AP series : "))

st = int(input("Enter step value of the AP series : "))

print("Series with initial value", ini, "& step value", st, "goes as:")

t1, t2, t3, t4 = retSeries(ini, st)

print(t1, t2, t3, t4)

Answered by upsales
1

Answer:

This Python Sum of the A.P program is the same as the above. Here, we used While Loop to display the A.P series, which is optional.

Explanation:

This Python program allows the user to enter the first value, the total number of items in a series, and the common difference. Next, Python finds the sum of the Arithmetic Progression Series.

Attachments:
Similar questions