Revision tools
You can print this page for a quick reference guide or you can use the tools below to create printable test sheets
6.1: understand the benefits of using subprograms
| Keyword | Definition |
|---|
| call | tell the program to actually execute (run) the subprogram |
| define | tells the program how to execute (run) the subprogram |
| function | a section of code with a name that can be re-used. It always returns a value |
| procedure | a section of code with a name that can be re-used. It can't return a value. |
| return | send data back to the part of the program which called the subprogram |
| subprogram | a section of code with a name that can be re-used (e.g. function or procedure) |
6.2: be able to write code that uses user-written and pre-existing (built- in, library) subprograms
| Keyword | Definition |
|---|
| library sub program | a procedure or function that can be used by importing a module (e.g. random.randint or time.sleep) |
| predefined sub program | a procedure or function that is built into the programming language (e.g. max, min, input or print) |
| user defined subprogram | a procedure or function that the user has written themselves |
6.3: understand the concept of passing data into and out of subprograms (procedures, functions)
| Keyword | Definition |
|---|
| call | make a procedure or function actually run |
| function | type of subprogram which is a section of code with a name that can be re-used. Always returns a value |
| parameter | a value that is passed to a subprogram by the part of the code which calls the procedure or function |
| procedure | type of subprogram which is a section of code with a name that can be re-used. Doesn't return a value. |
| return | go back from a procedure or function to the part of the program that called it |
| return value | data that is passed back from a procedure or function to the part of the program that called it |
6.4: understand the need for, and how to use, global and local variables when implementing subprograms
| Keyword | Definition |
|---|
| global variable | a variable which can be accessed from anywhere in a program |
| local variable | a variable which can only be read / written within a particular part of a program |
| scope | the part of a program where a variable can be accessed. |
| variable | memory storage location with a name that can store an individual value. The value can change when the program runs. |