Skip to content

Instantly share code, notes, and snippets.

@accessnash
Created June 1, 2018 13:11
Show Gist options
  • Select an option

  • Save accessnash/2cf494673e0b195ed12eec9d6f90b6cc to your computer and use it in GitHub Desktop.

Select an option

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
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