mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-12 09:44:24 +02:00
Adding documentation on ternary operator
This commit is contained in:
@@ -165,6 +165,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
|
||||
|
Reference in New Issue
Block a user