Question: function vs procedure

Hi all I see it is very easy to define a simple function in Maple using -> But what if more than a single expression is needed and if local variables are needed ? Is there a way to put several statements and use local variables in a function definition ? For example to define a function that takes a list as it's argument and returns the arithmetic mean or the simple sum. Must such things be done with a procedure ? Thanks !
Please Wait...