Logo

Programming-Idioms

History of Idiom 202 > diff from v4 to v5

Edit summary for version 5 by 0bit:
New Python implementation by user [0bit]

Version 4

2019-09-28, 22:04:53

Version 5

2019-09-29, 06:24:24

Idiom #202 Sum of squares

Calculate the sum of squares s of data, an array of floating point values.

Idiom #202 Sum of squares

Calculate the sum of squares s of data, an array of floating point values.

Code
s = sum(i**2 for i in data)