Hey everyone, I am just starting to learn iteration in Python. I am stuck on an assignment that my teacher gave me. I am supposed to make a code to display this:
1
-2
3
-4
5
-6
7
-8
So far my code is this:
counter=8
number=9
while counter>0:
print number+counter*-1
counter=counter-1
All it does is put out the numbers 1 through 8. I can get it to do numbers 1 through 8 in all odd also. I just haven't figured out how to make the negatives alternate. Any help would be amazing!