Leading zeros are generally not allowed, so if you had, say 503, then that's prime, 3 is prime, but 03 isn't allowed.
Ranges in Python don't include their endpoint. A few people have expressed confusion as to this choice in the design, but it means that the expression:
range(a,b) + range(b,c) + range(c,d)
includes everything from a to d-1 one and only once. Knuth said that intervals should include the initial point and not the endpoint for this reason.Regular ranges include their endpoints, and you can think of ^ as "not including" or "up to (exclusive)"
1..5 is 1, 2, 3, 4, 5
1..^5 is 1, 2, 3, 4
1^..5 is 2, 3, 4, 5
1^..^5 is 2, 3, 4
There's also convenient shorthand for 0..^n (useful if you want to do something n times): ^n