Update arithmeticProgressionSumFunc.py

This commit is contained in:
mahimadubey
2020-10-20 14:11:29 +05:30
committed by GitHub
parent 327b74b89d
commit 32d7fe0da1

View File

@@ -6,7 +6,7 @@ def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100):
d = random.randint(-1 * maxd, maxd)
a1 = random.randint(-1 * maxa, maxa)
a2 = a1 + d
a3 = a2 + d
a3 = a1 + 2*d
n = random.randint(4, maxn)
apString = str(a1) + ', ' + str(a2) + ', ' + str(a3) + ' ... '
problem = 'Find the sum of first ' + str(n) + ' terms of the AP series: ' + apString