diff options
author | Adam Bard <github@adambard.com> | 2016-02-14 22:53:51 -0800 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2016-02-14 22:53:51 -0800 |
commit | 582a205219ad4c14f093c6cf2965d566c8d0478a (patch) | |
tree | d7de1eab680d8c8ed5391a0749b2578ac384c7ef /python3.html.markdown | |
parent | 0c020f4da8563cbc9e509a63a1f03c1f53162c1c (diff) | |
parent | d2d89cfa9742ef437e45885498677038563d56f5 (diff) |
Merge pull request #1643 from ankitaggarwal011/python3-ternary-operator-documentation-add
[python3/en] Adding documentation on ternary operator
Diffstat (limited to 'python3.html.markdown')
-rw-r--r-- | python3.html.markdown | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python3.html.markdown b/python3.html.markdown index ff531b17..d88ccec1 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -174,6 +174,10 @@ some_var # => 5 # See Control Flow to learn more about exception handling. some_unknown_var # Raises a NameError +# if can be used as an expression +# Equivalent of C's '?:' ternary operator +"yahoo!" if 3 > 2 else 2 # => "yahoo!" + # Lists store sequences li = [] # You can start with a prefilled list |