CPSC120B
Fundamentals of Computer Science I

Post-lab 7

Range

The range function can be used to move around a numerical set in a very precise pattern. In this post-lab you will demonstrate your understanding of the range by writing a program to compute the sum of elements from a mathematical equation.

Sums

Create a program called sums.py that uses input to get a value n from the user, and computes sum (starting from 0) of every 5th y value from the equation y = x2 (up to but not including the value n):

$$0^2 + 5^2 + 10^2 + \ldots$$

Submission

Submit your code on the course Inquire site.