Julia Language Conditionals if statement with multiple branches


Example

d = Dates.dayofweek(now())
if d == 7
    println("It is Sunday!")
elseif d == 6
    println("It is Saturday!")
elseif d == 5
    println("Almost the weekend!")
else
    println("Not the weekend yet...")
end

Any number of elseif branches may be used with an if statement, possibly with or without a final else branch. Subsequent conditions will only be evaluated if all prior conditions have been found to be false.