Answer: Python Puzzler #1029

The answer is B. The program prints:

[1, 3, 5, 7]
What the program prints
Checked by running the program for real.

Why?

range(1, 8, 2) counts from 1 in steps of 2 and stops before 8.

The code again

print(list(range(1, 8, 2)))

Try it: change one number in the program and predict the new output before you run it.