Created
June 1, 2018 13:11
-
-
Save accessnash/2cf494673e0b195ed12eec9d6f90b6cc to your computer and use it in GitHub Desktop.
Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum. - Project Euler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| list = [] | |
| for i in range(1, 101): | |
| list.append(i**2) | |
| sumofsq = sum(list) | |
| sumlist = sum(range(1,101)) | |
| sqofsum = sumlist**2 | |
| diff = sumofsq - sqofsum | |
| print(diff) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment