""" first number: odd =1 next number: odd = odd+2 """ """ Solution from lecture 30/8. This prints the correct numbers, but generates one extra: """ n = 11 odd = 1 print("Version 1:") while odd <= n: print(odd) odd += 2 #odd = odd + 2 """ A slight adjustment of the loop solves this "problem". The following code generates exactly the numbers needed, and prints all: """ print("Version 2:") odd = 1 print(odd) while odd < n-1: odd += 2 #odd = odd + 2 print(odd) """ Terminal> python odd.py Version 1: 1 3 5 7 9 11 Version 2: 1 3 5 7 9 11 """