5 ms·
Well, booleans are integers, so you can do: >>> True + 1 2
by icebraining 9y ago
Well, booleans are integers, so you can do:
>>> True + 1
2
- ubernostrum 9y agoThat's not "coercion", though. That's Python obeying the LSP, because bool is a subclass of int.
- deleted 9y ago[deleted]
- chrfrasco 9y agofizzbuzz = lambda n: [print((“fizz” * m % 3 == 0) + (“buzz” * m % 5 == 0) or m) for m in range(n)] Not sure if this is great or terrible