# -1^(even) = +1
# -1^(odd) = -1
print("how to alternate positive / negative numbers:")
number = 5
for x in range(1, 8):
alternatingSign = (-1)**x
value = number * alternatingSign
print(value)
print("one way to work with odd numbers:")
for x in range(1, 10, 2):
print(x)
print("another way to work with odd numbers:")
startOdd = 1
for x in range(5): # number of next odd numbers to find
print(startOdd)
startOdd = startOdd + 2
print("one way to work with even numbers:")
for x in range(2, 11, 2):
print(x)
print("another way to work with even numbers:")
startEven = 2
for x in range(5): # number of next even numbers to find
print(startEven)
startEven = startEven + 2
print("multi-tasking:")
evenNumber = 0
oddNumber = 1
for x in range(0, 10):
evenNumber = evenNumber + 2
#evenNumber += 2 # (an equivalent way to express above)
oddNumber = oddNumber + 2
#oddNumber += 2 # (an equivalent way to express above)
print("x:", x, "evenNumber:", evenNumber, "oddNumber:", oddNumber)