3 ms·
Exactly. I pretty much love everything about Python except its ternary operator. I also prefer C’s.
by k_sze 5y ago
Exactly. I pretty much love everything about Python except its ternary operator. I also prefer C’s.
- version_five 5y agoWhen I first started using python, I assumed it had a normal (c-like) ternary operator and was a little surprised to discover the syntax we're talking about. But after some time, it actually feels very natural to me, and is arguably more intuitive than ?: syntax. I assume this is where the author is coming from.
- deleted 5y ago[deleted]
- mixmastamyk 5y agoArguably? It can be read like a sentence. ;-)
- Dylan16807 5y agoI assume they're talking about the meaning, not how you spell it. So you can read both as a sentence. The arguable part is more about "condition and then thing" versus "thing if condition".