The positive integers up to 2007 are alternately subtracted and added:
\[1 - 2 + 3 - 4 + \cdots + 2001 - 2002 + 2003 - 2004 + 2005 - 2006 + 2007.\]What is the value of the expression?
max = 2007

alternate = True

count = 0

for i in range(1, max+1):

  if alternate:

    count += i
    alternate = not alternate

  else:

    count -= i
    alternate = not alternate 

print(count)