Python program to print Arithmetic Progression series
Python program to print Arithmetic Progression series
In this, we discuss Arithmetic Progression series and check this series in Python Programming.
So this case, first of all we have to follow these steps to write the code.
Given first term (a),
common difference (d)
a integer n of the Arithmetic Progression series,
the task is to print the series.
After we use while loop to print the series. If you don't know about looping concept check the link given below first.
This Python program allows the user to enter the initial value, number of sequences, and the standard deviation. Next, Python receives a Arithmetic Progression Series.
Python Series A.P.
In mathematics after calculating the Arithmetic Progression Series
Tn's A.P. Series: Tn = a + (n - 1) d
According to Wikipedia, arithmetic progression (AP) is such a sequence of numbers that the differences of any two consecutive members are permanent. For example, sequences 3, 5, 7, 9, 11, 13,. . . development of arithmetic and standard deviation 2.
In this case, we will limit the continuity of arithmetic whose general variance is zero. On the other hand, geometric progression (GP) is a sequence of numbers in which each term after the first is obtained by multiplying the previous one by a non-zero number set by the so-called standard measure.
For example, sequences 2, 6, 18, 54,. . . progression of Geometry by standard measure 3. With this problem, we will limit him to geometric continuity whose standard is a non-zero sum.
Now take a look at Python program to print Arithmetic Progression series
Python Code:
a = int(input('enter first term'))
d = int(input('enter common difference'))
n = int(input('enter number of terms'))
print('AP series as follows')
m = 1while(m<=n):
tm = a + (m-1)*d
print(tm)
m = m+1
Output:
enter first term 1
enter common difference 2
enter number of terms 4
AP series as follows
1
3
5
7
Recommended Post:Program to check whether the number is prime or not
Plotting of even, odd, prime numbers from a list
Subplot of even, odd and prime numbers from a list
Python Program to print Arithmetic Progress series
Program to find even and odd numbers from the list
Program to check whether a number is odd or even