1. In python subroutines are often referred to as 'functions' (although in other languages a function only returns a single value). How many functions can you spot in the code below?
2. All of the following statements are true:
1.Functions/Subroutines make programs more readable.
2. They reduce the duplication of code.
3. Complex problems are broken down into smaller chunks.
3. Which key word is used for the creation of functions/subroutines in Python?
4. What is the output of the code below?
5. On what line(s) can you spot parameter passing? (Note: a parameter is also called an 'argument' but can just be thought of as the variables that are being passed)
6. In the following program '3' and '4' are the parameters that have been passed to the subroutine printMax. What is the output of the following program?
7. Variables can either be inside subs/functions or outside them. If the variables are inside, they are referred to as being 'local variables' or having 'local scope'. Variables that are declared outside are called G_________ variables.
8. Type out the code for yourself. The output is "Value of x is, 2"
9. What is the output of the following program - it has been passed the parameters 2 and 3. Note the use of the RETURN statement that is commonly used in functions to return a value
10. For the purposes of learning theory, it is useful to remember that a FUNCTION returns a single value, where as a subroutine(subroutines are also called either procedures or methods) does not necessarily just return a single value. Correctly identify Test1