Julia control flow
Julia has a complete set of control flows. As an example, we could have a small function that determines the larger of two numbers:
function larger(x, y) if (x>y) return x end return y end println(larger(7,8))
There are several features that you must note:
The
end
statement for theif
statementend
the closing of thefunction
Indentation of the statements within the
function
Indentation of the handling of a
true
condition within anif
statement
If we run this in Jupyter, we see the output shown in the following screenshot: