3 ms·
One difference is that this won't do exhaustiveness checks, where the pattern match will.
by steveklabnik 12y ago
One difference is that this won't do exhaustiveness checks, where the pattern match will.
- Erwin 12y agoWell, here's an exhaustively checking version. Not statically still of course. for x in range(1,101): print [ # %3 = 0 [ x, "Fizz" ], [ "Buzz", "FizzBuzz"] # %5 = 0 ][x%3 == 0][x%5 == 0] (I'll note this was hard to get than if-checks and pattern matching so I won't be replacing such logic with matrices in my Python program any time soon...)
- steveklabnik 12y ago> not statically of course Right, but that's the point!