summaryrefslogtreecommitdiffhomepage
path: root/python3.html.markdown
diff options
context:
space:
mode:
authorPetru Dimitriu <dimitriupetru@gmail.com>2016-02-15 20:32:50 +0200
committerPetru Dimitriu <dimitriupetru@gmail.com>2016-02-15 20:32:50 +0200
commit3bfea3740c865d07879d56b698b075dc43342184 (patch)
treeebc3c861b23bbe62a859a33ee81ec54eaf7febaa /python3.html.markdown
parent528a761ca68b5d30fac6aed9686104a483467be6 (diff)
parent712c9f342ff054039bd8e93a43be6ea0846ebc83 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'python3.html.markdown')
-rw-r--r--python3.html.markdown4
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