Robotics & Artificial Intelligence
Design Python code to find and display the sum of the following series:
s = (1*2) + (2*3) + …………… + (19*20)
Python Control Flow
1 Like
Answer
s = 0
for i in range(1, 20):
s = s + (i * (i + 1))
print("Sum of the series =", s)Output
Sum of the series = 2660
Answered By
3 Likes
Related Questions
Write Python code to display the first ten terms of the following series:
2, 5, 10, 17, ……………
Design Python code to find and display the sum of the following series:
s = 1 + 4 + 9 + …………… + 400
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:
1 + (1*2) + (1*2*3) + …………… + (1*2*3*……………*n)