Adding documentation on ternary operator

This commit is contained in:
Ankit Aggarwal 2015-10-16 20:42:03 +05:30
parent 91218b4fce
commit 451ccaec5b

View File

@ -165,6 +165,7 @@ some_var # => 5
some_other_var # Raises a name error some_other_var # Raises a name error
# if can be used as an expression # if can be used as an expression
# Equivalent of C's '?:' ternary operator
"yahoo!" if 3 > 2 else 2 # => "yahoo!" "yahoo!" if 3 > 2 else 2 # => "yahoo!"
# Lists store sequences # Lists store sequences