Ternary
operator( ?: )
Returns one of two expressions depending
on a condition.
Syntax
condition ? expression1 : expression2
Returns expression1 if the condition evaluates to true other wise returns expression 2.
Returns expression1 if the condition evaluates to true other wise returns expression 2.
julia> a=10; julia> info=((a==10)?"a is equal to 10":"a is not equal to 10") "a is equal to 10" julia> a=11; julia> info=((a==10)?"a is equal to 10":"a is not equal to 10") "a is not equal to 10"
No comments:
Post a Comment