Print statements in a for loop
<p>I am working on a function  which takes a positive integer <code>N</code> and computes the following sum:</p>

<pre><code>1 - 2 + 3 - 4 + 5 - 6 + .... N. 
</code></pre>

<p>My professor said we can not use "math formulas" on this, so how could I go about it?</p>

<p>I thought about using a <code>for</code> loop, but I don't know how or what to write for the <code>print</code> statement. This is what I have so far:</p>

<pre><code>n=int(input("enter N="))
for i in range(1, n+1, 1):
    if i % 2 == 0:
        # I'm not sure what print statement to write here
</code></pre>

<p>I tried <code>print(i= "+" i+1)</code> and just weird stuff like that, but I get errors and am lost after that.</p>

<p>what i have now</p>

<pre><code>n=int(input('enter N='))
total=0
print("sum",)
for i in range(1, n+1, 1):
    if i % 2 == 0:
        count=count - i
        print("-", i)
    else:
        count=count + i
        print("+", i, end=" ")
print("=", total)

#still get errors saying name count not defined and unsupported sperand for +:   
</code></pre>
