Julia function keyword | Create user-defined functions in Julia Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Keywords are the reserved words in Julia which have a predefined meaning to the compiler. These keywords are used to reduce the number of lines in code. Keywords in Julia can't be used as variable names. 'function' keyword is used to create user-defined functions in Julia. These functions are reusable codes that can be called from anywhere in the code with the name assigned to the function. Syntax: function function_name Statement Statement end Note: 'end' keyword is used to mark the ending of a function. Everything between the function keyword and end keyword is considered to be the body of the function. Example: Python3 1== # Julia program to illustrate # the use of 'function' keyword # Defining a function function func() println("this is a function") end # Function call func() Output: this is a function Creating Functions with arguments Functions in Julia also accept arguments. These functions are also created in the same way by using the 'function' keyword. Syntax: function function_name(argument1, argument2, ...) statement statement end Example: Python3 1== # Defining a function with arguments function add_fn(x, y) println(x + y) end # Calling defined function add_fn(10, 8) Output: 18 Comment More infoAdvertise with us Next Article if keyword - Conditional evaluation in Julia A Abhinav96 Follow Improve Article Tags : Julia Julia-keywords Similar Reads Julia break Keyword | Exiting from a loop in Julia Keywords in Julia are predefined words that have a definite meaning to the compiler. These keywords can't be used to name variables. 'break' keyword in Julia is used to exit from a loop immediately. Whenever the break keyword is executed, the compiler immediately stops iterating over further values 1 min read Fruitful Functions and Void Functions in Julia Functions are one of the most useful tools when writing a program. Every programming language including Julia uses functions, it can be for keeping the code simple and readable or to keep the program secure from outside interference. In almost every programming language there are two types of functi 2 min read Julia global Keyword | Creating a global variable in Julia Keywords in Julia are reserved words whose value is pre-defined to the compiler and can not be changed by the user. These words have a specific meaning and perform their specific operation on execution. 'global' keyword in Julia is used to access a variable that is defined in the global scope. It ma 2 min read if keyword - Conditional evaluation in Julia Keywords in Julia are reserved words that have a specific meaning and operation to the compiler. These keywords can not be used as a variable name, doing the same will stop the execution process and an error will be raised. 'if' keyword in Julia is used to evaluate a condition. If the condition is t 2 min read Pure Functions and Modifiers in Julia Functional programming is very common nowadays, where we have to write a function to update and modify the variables or do some modifications according to the requirement. In Julia, we have two approaches to update and modify the variables and objects that are Pure Functions and the others are Modif 3 min read Julia end Keyword | Marking end of blocks in Julia Keywords in Julia are reserved words that have a pre-defined meaning to the compiler. These keywords can't be used as a variable name. 'end' keyword in Julia is used to mark the end of a block of statements. This block can be of any type like struct, loop, conditional statement, module, etc. Syntax: 1 min read Like