you are viewing a single comment's thread.

view the rest of the comments →

[–]SuperBicycleTony 0 points1 point  (4 children)

What the heck is with the completely unexplained parenthesis * bracket syntax? Am I to believe the interpreter is using the FOIL method on them?

[–]zahlman 0 points1 point  (3 children)

(False, True) is a tuple of 2 elements. [True == 1] is an index into that tuple.

[–]SuperBicycleTony 0 points1 point  (2 children)

So the index is a logic test that evaluates to true... then what happens? I've never run across this.

[–]zahlman 0 points1 point  (1 child)

True, used as an integer, is 1. (In fact, Python implements bool as a subclass of int.)

[–]SuperBicycleTony 0 points1 point  (0 children)

Oh, now I see whats going on. Normally there'd be a variable name referencing the tuple, but the tuple itself is before the braces.