Introduction

In the last edition of The Comprehensive Julia Tutorial, we took a look at installing Julia, Julia’s package manager (Pkg,) and we also took a short look at types inside of the Julia language.

Today we are going to take a look at actually writing functions to deal with our types, as well as a broad overview of how conditionals work inside the Julia language. On top of that, we will go a bit further into the world of types and look at a few more types that we have at our disposal.

Functions

In Julia, most functions are also going to be methods. This is because essentially every function we call is likely going to need to be provided parameters. This is of course a quality of the functional programming paradigm that Julia holds, but there are ways to get around this which we will get into so take this statement with a grain of salt. In Julia, we can create a function by using the “ function” key-word.

function foo(parameter)
    code_here
end

We will also end it by using the “ end” key-word. Functions take parameters, which are arguments that will be provided when we go to use the function in the future. They will also be the variables that we will potentially be working with inside of our code.

#programming #data-science #tutorial #julia #beginner

An Introduction To Conditions And Methods In Julia
1.05 GEEK