A set of blocks that allow you to create and call functions. Functions are handy for structuring and reusing repetitive logic
![](/files/latest/en/2260867238/2273051474/1/1674655297804/image_13.png)
You can define functions with or without a return value
![](/files/latest/en/2260867238/2273051475/1/1674655314906/image_23.png)
You can define functions that accept parameters as input arguments
![](/files/latest/en/2260867238/2260867241/2/1674655335514/gif_1.gif)
You can add a description to any function
![](/files/latest/en/2260867238/2273051477/1/1674655357740/image_32.png)
Once you have defined a function, blocks will appear in the “Functions” section to call it
![](/files/latest/en/2260867238/2273051478/1/1674655376998/image_42.png)
A block for calling a function without parameters that does not return a value
![](/files/latest/en/2260867238/2260867245/2/1674655395833/image_5.png)
A block for calling a function with parameters and a return value
![](/files/latest/en/2260867238/2260867246/2/1674655416276/image_6.png)
Example
Let’s create a function that calculates the length of the hypotenuse. It will take the length of the legs as parameters
![](/files/latest/en/2260867238/2260867247/2/1674655436447/image_7.png)
Simple functions like this can be written shorter - move the hypotenuse calculation to “return”, and in the function settings uncheck “Allow operators”
![](/files/latest/en/2260867238/2260867248/2/1674655456413/image_8.png)
Function call
![](/files/latest/en/2260867238/2260867249/2/1674655477555/image_9.png)