Java Jester

Ternary Operator in Python Does not Make Sense

I don't know why python did'nt simply followed the standard way of using a ternary operator. Instead of following the usual format:

(x > 10) ? true_value : false_value

Python uses a different one:

x > 10 and true_value or false_value

 

Comments (0)


recommended books
Jester Cap Logo by Vonn reyjexter.com | Valid XHTML & CSS | 2008 | Design & Devt. by: vonnhugo

powered by:

django framework python google app engine