WGU D335 Introduction To Programming Final
Exam Review (Python) – Questions With
Complete Solutions
A ________ does not prevent the program from running, but causes it
to produce incorrect result Correct Answer - Syntax Error
A ______ is sequence of characters Correct Answer - String
A ____ is a name that references a value in the computer's memory
Correct Answer - Variable
A _____ in python must be enclosed in either single or double-quotes
Correct Answer - String Literal
Short notes placed in different parts of a program explaining how
these parts of the program work are called Correct Answer -
Comments
A(n) ______ makes a variable reference a value in the computer's
memory Correct Answer - Assignment Statement
The ___ symbol marks the beginning of a comment in python
Correct Answer - #
Values on the right and left of an operator symbol (+) are called:
Correct Answer - Operands
______ can be used to read input that has been typed on the keyboard
Correct Answer - input()
having float(aroundSomething) Correct Answer - converts to a
float
,A magic number is an: Correct Answer - unexplained value
that appears in a program's code
A _____ is a name that represents a value that does not change during
the program's execution Correct Answer - Named Constant
First characters of a variable names: Correct Answer - cannot
be a number
If a variable has not been assigned a value Correct Answer - 0
will not display since the variable was not assigned 0 to begin with
A _____ can execute a set of statements only certain circumstances
Correct Answer - Decision Structure
A ____ provides one alternative path of executions Correct Answer
- Single Alternative Decision
Boolean has a value of either Correct Answer - True or False
A compound boolean expression created with the "or" operator is
true if: Correct Answer - Either of its sub-expressions are true
A ____ can be nested inside another decision structure Correct
Answer - Decision structure
A compound boolean expression created with the "and" operator is
true only when: Correct Answer - Both sub-expression sare
true
The while loop is a ___ type of loop Correct Answer - Pretest
, An ____ loop has no way of ending and repeats until the program is
interrupted Correct Answer - Infinite Loop
The -= operator is an example of a(n) _______ Correct Answer -
augmented assignment operator
A(n) ______ is a special value that signals when there are no more
items from a list of items to be processed. This value cannot be
mistaken as an item from the list Correct Answer - sentinel
It is _____ that a condition-controlled loop always repeats a specific
number of times Correct Answer - false
x= x-1 does? Correct Answer - subtracts 1 from x
It is necessary to initialize ______ Correct Answer - accumulator
variables
In a ________, the inner loop goes through all of its iterations for every
single iteration of the outer loop Correct Answer - nested loop
To calculate the total number of iterations of a nested loop, you ____
the number of iterations of all the loops Correct Answer -
multiply
Design technique that helps to reduce the duplication of code within
a program and is a benefit of using functions is _____ Correct
Answer - code reuse
The first line of a function definition is known as the _____ Correct
Answer - header
You ____ a function to execute it Correct Answer - call
Exam Review (Python) – Questions With
Complete Solutions
A ________ does not prevent the program from running, but causes it
to produce incorrect result Correct Answer - Syntax Error
A ______ is sequence of characters Correct Answer - String
A ____ is a name that references a value in the computer's memory
Correct Answer - Variable
A _____ in python must be enclosed in either single or double-quotes
Correct Answer - String Literal
Short notes placed in different parts of a program explaining how
these parts of the program work are called Correct Answer -
Comments
A(n) ______ makes a variable reference a value in the computer's
memory Correct Answer - Assignment Statement
The ___ symbol marks the beginning of a comment in python
Correct Answer - #
Values on the right and left of an operator symbol (+) are called:
Correct Answer - Operands
______ can be used to read input that has been typed on the keyboard
Correct Answer - input()
having float(aroundSomething) Correct Answer - converts to a
float
,A magic number is an: Correct Answer - unexplained value
that appears in a program's code
A _____ is a name that represents a value that does not change during
the program's execution Correct Answer - Named Constant
First characters of a variable names: Correct Answer - cannot
be a number
If a variable has not been assigned a value Correct Answer - 0
will not display since the variable was not assigned 0 to begin with
A _____ can execute a set of statements only certain circumstances
Correct Answer - Decision Structure
A ____ provides one alternative path of executions Correct Answer
- Single Alternative Decision
Boolean has a value of either Correct Answer - True or False
A compound boolean expression created with the "or" operator is
true if: Correct Answer - Either of its sub-expressions are true
A ____ can be nested inside another decision structure Correct
Answer - Decision structure
A compound boolean expression created with the "and" operator is
true only when: Correct Answer - Both sub-expression sare
true
The while loop is a ___ type of loop Correct Answer - Pretest
, An ____ loop has no way of ending and repeats until the program is
interrupted Correct Answer - Infinite Loop
The -= operator is an example of a(n) _______ Correct Answer -
augmented assignment operator
A(n) ______ is a special value that signals when there are no more
items from a list of items to be processed. This value cannot be
mistaken as an item from the list Correct Answer - sentinel
It is _____ that a condition-controlled loop always repeats a specific
number of times Correct Answer - false
x= x-1 does? Correct Answer - subtracts 1 from x
It is necessary to initialize ______ Correct Answer - accumulator
variables
In a ________, the inner loop goes through all of its iterations for every
single iteration of the outer loop Correct Answer - nested loop
To calculate the total number of iterations of a nested loop, you ____
the number of iterations of all the loops Correct Answer -
multiply
Design technique that helps to reduce the duplication of code within
a program and is a benefit of using functions is _____ Correct
Answer - code reuse
The first line of a function definition is known as the _____ Correct
Answer - header
You ____ a function to execute it Correct Answer - call