Can we solve this Arithmetic Problem using Python in a more efficient way?
If you want the sum of 3n+2 for 1<=n<=15 then:
print(sum(3*n+2 for n in range(1,16)))
Output:
390
If you want the sum of 3n+2 for 1<=n<=15 then:
print(sum(3*n+2 for n in range(1,16)))
Output:
390