Robotics & Artificial Intelligence

Design Python code to find and display the sum of the following series:

s = 1 + 4 + 9 + …………… + 400

Python Control Flow

1 Like

Answer

s = 0
for i in range(1, 21):
    s = s + i*i
print("Sum of the series =", s)

Output

Sum of the series = 2870

Answered By

1 Like


Related Questions