KnowledgeBoat Logo
|

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

2 Likes

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

2 Likes


Related Questions