1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-11 17:24:29 +02:00

Merge pull request #1560 from ankitaggarwal011/python27-ternary-operator-doc-add

[python/en] Adding documentation on ternary operator
This commit is contained in:
Levi Bostian
2015-10-18 12:15:55 -05:00

View File

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