Year 11
Lesson details
Key learning points
- In this lesson, we will explore how to create our own functions. Functions are a type of subroutine that allow us to return a value. We have used them before when we have used code like print() and input(). We will also explore the difference between a function and procedure.
Licence
This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.
Loading...
3 Questions
Q1.
In the image above, how many parameters does the subroutine "calculate" take?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707166643%2Ffx4dpw6slhwxwrfxxjok.png&w=1080&q=75)
1
3
4
Q2.
In the image above, which one of the statements below best describes what is happening at line 10?
It is adding a and b but will not output the answer until the subroutine has been called
It will prompt the user to enter two numbers
The subroutine calculate is being created/defined.
Q3.
Using the image above, on line 1, are "a" and "b" described as arguments or parameters?
Arguments
3 Questions
Q1.
What will be the return value based on the function call to_the_power(3,2)?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707167350%2Fl1hasn0kcird1pbpfnam.png&w=1920&q=75)
12
3
6
Q2.
What will be the return value based on the function call find_highest(12,9)?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707167209%2Fudbilyuv69lvcejid4py.png&w=1200&q=75)
3
9
No return value
Q3.
What will be the return value based on the function call multiple(30,3)?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707167211%2Feyaryrap2aygo9sx0gzg.png&w=1200&q=75)
No