Blame view

6.py 355 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python

import sys;

def sumSquares(start, end):

	num = 0;
	for i in range (start, end+1):
		num += i**2;

	return num;

def squareSum(start,end):

	num = 0;
	for i in range (start, end+1):
		num += i;

	return num**2;

start = int(sys.argv[1]);
end = int(sys.argv[2]);

print "Result is: " + str(squareSum(start,end) - sumSquares(start,end));