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
endstatement for theifstatementendthe closing of thefunctionIndentation of the statements within the
functionIndentation of the handling of a
truecondition within anifstatement
If we run this in Jupyter, we see the output shown in the following screenshot:
