Arithmetic Progression Series Python
PROGRAM TO PRINT ARITHMETIC PROGRESSION SERIES
OUTPUT
2 3 4 5 6
def printAP(a,d,n): # Printing AP by simply adding d # to previous term. curr_term curr_term=a for i in range(1,n+1): print(curr_term, end=' ') curr_term =curr_term + d # Driver code a = 2 # starting number d = 1 # Common difference n = 5 # N th term to be find printAP(a, d, n)
2 3 4 5 6
Comments
Post a Comment