focused on Chapters 1-4 Study guide Exam
Questions with Key Marking Scheme Updated
2024/2025
Algorithm - correct answer Is a methodical step-by-step
procedure to perform a task.
Computational thinking - correct answer the method of
evaluating a problem's most basic parts and then creating an
algorithm to solve that problem.
Python interpreter - correct answer For Python, an
application that can be used on various operating systems,
including Microsoft Windows, Linux, and MacOS.
Interactive interpreter - correct answer A program that
allows the user to execute one line of code at a time.
Code (Coding) - correct answer A common word for the
textual representation of a program.
Line - correct answer A row of text.
The interactive interpreter displays a prompt(">>>") - correct
answer (">>>") that indicates the interpreter is ready to
accept code.
,Prompt - correct answer Informs the programmer that the
interpreter is ready to accept commands.
statement - correct answer A program instruction.
True - correct answer True or false. A program mostly
consists of a series of statements, each statement usually
appears on its own line.
Expression - correct answer Code that returns a value when
evaluated; for example, the code wage * hours * weeks is an
expression that computes a number. * is the symbol for
multiplication. The names wage, hours, weeks, and salary are
variables, which are named references to values stored by the
interpreter.
assignment - correct answer A new variable is created by
performing an ___________ using the = symbol, such as salary =
wage * hours * weeks, which creates a new variable called salary.
print() - correct answer Displays variables or expression
values.
comments - correct answer #' characters denote ____________,
which are optional but can be used to explain portions of code to
a human reader.
print() - correct answer The primary way to print output is to
us the built-in function _________.
,string literal - correct answer Text enclosed in quotes is
known as a ...
False - correct answer True or False. Text in string literals
may not have letters, numbers, spaces, or symbols like "@" or
"#".
print('Hello', end = ' ') - correct answer Multiple print
statements will each print on a new output line. How would you
keep the next print's output on the same line separated by a
single space?
True - correct answer True or False. A string literal can be
surrounded by matching single or double quotes: 'Python rocks!'
or "Python rocks!". Good practice is to use single quotes for
shorter strings, and double quotes for more complicated text or
text that contains single quotes (such as print("Don't eat that!")).
"print('Halt!', end = ' ') print('No access!')" - correct answer
Write code that will print "Halt!" and "No access!" on a single
line.
print('Welcome!') - correct answer Write code that will print:
Welcome!
print(num_cars) - correct answer Given the variable
num_cars = 9, write a statement that prints 9.
, "wage = 20 print('Wage:' , wage) #Comma separates multiple
items print('Goodbye.')" - correct answer "Write code that
prints the following: Wage: 20 Goodbye."
You are 22 years old. - correct answer "Assume variable age
= 22 What is the output of print('You are' , age, 'years old.')"
newline character - correct answer A new line can also be
output by inserting \n, known as a ______________ ___________,
within a string literal.
input() - correct answer Reading input is achieved using the
________ function.
num_cars = input() - correct answer Write a statement that
reads a user-entered string into variable num_cars.
type - correct answer Determines how a value can behave.
my_var = int('15') - correct answer Type a statement that
converts the string '15' to an integer, and assigns the result to
my_var.
my_var + 5 - correct answer "Complete the code so that
new_var is equal to the entered number plus 5. my_var =
int(input()) new_var = _______"