OK, teaching python to the kids. We just wrote our first little program:
b = 0
for a in range (1, 10)
b = b + 1
print a, b
Stops at 9, 9. They asked "why is that" and I can't say that I know the answer.
My code always involves files, and my "for row in reader" doesn't stop one line short, so I don't actually know. In mathematical notation, this behavior would be [1,10)
. Technically (1,10)
would be 2,3,4,5,6,7,8,9
, and indeed I want [1,10]
.