INSY 3300 Exam 2025 Questions and
Answers
What is a function? - --Answer --A function is a group of statements that
exist within a program for the purpose of performing a specific task.
What is meant by the phrase "divide and conquer" ? - --Answer --Dividing a
large program or task into several smaller tasks that are easily managed and
performed.
How do functions help you reuse code in a program? - --Answer --If a
specific operation is performed in several places in a program, a function can be
written once to perform that operation and then be executed any time it is needed.
How can functions make the development of multiple programs faster? - --
Answer --Functions can be written for the commonly needed tasks, and
those functions can be incorporated into each program that needs them.
....COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED...TRUSTED & VERIFIED 1
,How can functions make it easier for programs to be developed by teams of
programmers? - --Answer --When a program is developed as a set of
functions that each performs an individual task, then different programmers can be
assigned the job of writing different functions.
What is a function definition? - --Answer --The definition (code) that is
written to create a function. It specifies what a function does.
A function definition has what two parts? - --Answer --Function Header;
Block
What does the phrase "calling a function" mean? - --Answer --To execute a
function, a function call is required. "Calling a function" is a statement that is used
to invoke (execute) the function at required places in a program.
When a function is executing, what happens when the end of the function's block
is reached? - --Answer --When the end of the block is reached, the
interpreter jumps back to the part of the program that called the function, and the
program resumes execution at that point. When this happens, we say that the
function "returns".
Why must you indent the statements in a block? - --Answer --Indentation is
required because the Python interpreter uses it to tell where the block begins and
ends.
....COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED...TRUSTED & VERIFIED 2
, What is a variable's scope? - --Answer --It is the part of a program in which
the variable may be accessed.
What is a local variable? - --Answer --A variable that is declared within a
function and cannot be accessed by statements that are outside of the function.
In addition, a local variable cannot be accessed by code that appears inside the
function at a point before the variable has been created.
How is access to a local variable restricted? - --Answer --A local variable
belongs to the function in which it is created, and only statements inside that
function can access the variable.
Is it permissible for a local variable in one function to have the same name as a
local variable in a different function? - --Answer --Yes;
Different functions can have local variables with the same names because the
functions cannot see each other's local variables.
What are the pieces of data that are passed into a function called? - --
Answer --arguments
What are the variables that receive pieces of data in a function called? - --
Answer --parameters
....COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED...TRUSTED & VERIFIED 3