May 2019
Beginner to intermediate
466 pages
10h 44m
English
An if,then and else type of condition can be expressed using the ternary operator ? :. Its syntax is as follows:
x ? y : z
If x is true, the expression y is evaluated—otherwise, z gets evaluated instead. For instance, consider the following code:
julia> x = 10 10 julia> x < 0 ? "negative" : "positive" "positive"
Read now
Unlock full access