Functions
1 / 13
Functions 1 / 13 Functions A function is a reusable block of code. - - PowerPoint PPT Presentation
Functions 1 / 13 Functions A function is a reusable block of code. Functions have names (usually), contain a sequence of statements, and return values, either explicitly or implicitly. Weve already used several built-in functions.
1 / 13
◮ have names (usually), ◮ contain a sequence of statements, and ◮ return values, either explicitly or implicitly.
2 / 13
3 / 13
◮ The first line is called the header. ◮ function_name is the name you use to call the function. ◮ parameter_list is a list of parameters to the function, which may
◮ function_body is a sequence of expressions and statements.
4 / 13
5 / 13
6 / 13
7 / 13
8 / 13
9 / 13
10 / 13
11 / 13
12 / 13
13 / 13