Question: 
Write a function to find the sum of arithmetic progression.


Model's Code:
def ap_sum(a, n, d):
    return n * (2 * a + (n - 1) * d) // 2



Sample Correct Code:
def ap_sum(a,n,d):
  total = (n * (2 * a + (n - 1) * d)) / 2
  return total


Asserts:
assert ap_sum(1,5,2)==25
assert ap_sum(2,6,4)==72
assert ap_sum(1,4,5)==34


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 335 of 974: 242/335 (72.23880597014926%): success