Reply to post: Re: Sin tax

Python swallows Java to become second-most popular programming language... according to this index

CrackedNoggin Bronze badge

Re: Sin tax

"Their habit of doing things *slightly* different from everyone else"

The ternary operator

value_if_true if condition else value_if_false

It was wedged in as an afterthought in 2006 v2.5. IMO, it's ugly.

Presumably a ternary was initially judged to be unnecessary, in order to keep the language clean and simple.

This way is also possible

(value_if_true, value_if_false)[if condition]

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon