re: Things that weren't so obvious when you started to program in Python VIEW POST

VIEW FULL DISCUSSION
 

That "one-line conditional" is basically the ternary operator, but with the condition in the middle instead of the first operand, which is pretty unique among languages.

Python has always had this thing of writing expressions (especially conditionals) after one would expect them, based on the experience with other languages, but in the end they all make (at least some) sense.

code of conduct - report abuse