This site is best viewed in Mozilla Firefox or Google Chrome
Fri, 18th May 2012 03:09:53
Never fear, this site is here  

Pages: 1

#Ternary operator in Python

People are always wondering if Python has a ternary operator. The answer is yes but no.

There is no recognised ternary operator. However it is very simple to construct one out of logic operations.

Python short circuits conditional evaluations. This means that given a series of logic operations, if it can plainly see that a certain branch of that logic is unreachable or of no consequence it wont even attempt to execute it.

...

Read more

There is 1 comment on this post. Make a comment.

Pages: 1

Powered by Debian, Jack Daniels, Guinness, and excessive quantities of caffeine and sugar.