Robotics & Artificial Intelligence
Write Python code to find the sum of the given series:
1 + (1+2) + (1+2+3) + …………… + (1+2+3+……………+n)
Python Control Flow
2 Likes
Answer
n = int(input("Enter the value of n: "))
s = 0
for i in range(1, n+1):
t = 0
for j in range(1, i+1):
t = t + j
s = s + t
print("Sum of the series =", s)Output
Enter the value of n: 6
Sum of the series = 56
Answered By
1 Like
Related Questions
Design Python code to find and display the sum of the following series:
s = 1 + 4 + 9 + …………… + 400
Design Python code to find and display the sum of the following series:
s = (1*2) + (2*3) + …………… + (19*20)
Write Python code to find the sum of the given series:
1 + (1*2) + (1*2*3) + …………… + (1*2*3*……………*n)
Write Python code to find the sum of the given series:
S = 1! + 2! + 3! + 4! + …………… + n!
[Hint: Factorial of 5! = 5*4*3*2*1]