LearnPy Hub
← Iterators & Generators problems
Easy

Sum of Squares (Generator Expression)

Read n and print the sum of i² for i = 1..n, using a generator expression.

Input

One integer.

Output

The sum.

Sample 1

Input
3
Output
14

Sample 2

Input
1
Output
1
solution.py
Output appears here
Sum of Squares (Generator Expression) · Python practice problem · LearnPy Hub