Skip to content

Instantly share code, notes, and snippets.

@yuda110
Last active April 22, 2016 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuda110/e57c321e88d0c7492d45f62a1777ef16 to your computer and use it in GitHub Desktop.
Save yuda110/e57c321e88d0c7492d45f62a1777ef16 to your computer and use it in GitHub Desktop.
#python3
def sum_square(range_from, range_to) :
sum_square = 0
for i in range(range_from, range_to) :
sum_square += i**2
return sum_square
def square_sum(range_from, range_to) :
sum = 0
for i in range(range_from, range_to) :
sum += i
return sum**2
print(square_sum(1, 101) - sum_square(1, 101))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment