Font size
WorksheetsPython Exam 1
Total questions: 97
Worksheet time: 49mins
A ____-controlled loop uses a true/false condition to control the number of times it repeats.
Boolean
condition
decision
count
A _____-controlled loop repeats a specific number of times.
count
condition
Boolean
decision
Each repetition of a loop is known as a(n)
cycle
orbit
revolution
iteration
a WHILE loop is...
condition controlled
count controlled
loops forever
never loops
The -= operator is an example of a(n) operator.
relational
augmented assignment
complex assignment
reverse assignment
A(n) ____ variable keeps a running total.
sentinal
sum
total
accumulator
A(n) ____ is a special value that signals when there are no more items from a list of items to be processed.
sentinel
flag
signal
accumulator
GIGO stands for?
Gogobytes Gigibytes
Garbage Input Garbage Output
Garbage in Garbage Out
Garbage Incorrect Garbage Output
The integrity of a program’s output is only as good as the integrity of the program’s ____.
compiler
programming language
input
debugger
The input operation that appears just before a validation loop is known as the ____.
priming read
initialization read
error trap
prevalidation input
Validation loops are also known as ____.
error traps
doomsday loops
error avoidance loops
defensive loops
A condition-controlled loop always repeats a specific number of times.
True
False
While loop is a pretest loop
True
False
The following statement subtracts 1 from x: x = x - 1
True
False
It is not necessary to initialize accumulator variables.
True
False
In a nested loop, the inner loop goes through all of its iterations for every single iteration of the outer loop.
True
False
To calculate the total number of iterations of a nested loop, add the number of iterations of all the loops.
True
False
Input validation loop works like this: when the user enters invalid data, it should ask the user "Are you sure? yes/no".
True
False
This type of loop can repeat an undetermined number of times.
for
while
A ___ error does not prevent the program from running, but causes it to produce incorrect results.
syntax
hardware
logical
fatal
A ___ is a single function that the program must perform in order to satisfy the customer.
Task
Software requirement
Prerequisite
Predicate
A(n) ___ is a set of well-defined logical steps that must be taken to perform a task.
logarithm
plan of action
logic schedule
algorithm
An informal language that has no syntax rules and is not meant to be compiled or executed is called _______.
faux code
pseudocode
Python
flowchart
A _______ is a diagram that graphically depicts the steps that take place in a program.
flowchart
step chart
code graph
program graph
A sequence of characters that can be typed.
LOOP
STRING
VARIABLE
LIST
A _______ is a name that references a value in the computer's memory.
variable
register
RAM slot
byte
A _______ is any hypothetical person that is using a program and providing input for it.
Designer
User
Guinea pig
Test subject
A string literal in Python must be enclosed in
parentheses
single-quotes
double-quotes
either single-quotes or double-quotes
Short notes placed in different parts of a program explaining how those parts of the program work are called __.
Comments
Reference manuals
Tutorial
External documentation
A(n) _______ makes a variable reference a value in the computer's memory.
variable declaration
assignment statement
math expression
string literal
This symbol marks the beginning of a comment in Python
&
#
++
=
Which of the following statements will cause an error?
x = 17
17 = x
x = '99999'
x = '17'
In the expression 12 + 7, the values on the right and left of the + symbol are called:
operands
operators
arguments
math expressions
This operator performs integer division:
//
%
/
*
This is an operator that raises a number to a power
%
//
**
/
This operator performs division, but instead of returning the quotient it returns the remainder
%
**
//
/
price = 99.0 . After this statement executes, the price will be of which data type?
int
float
currency
str
Which built-in function can be used to read input that has been typed on the keyboard?
get_input()
read_input()
keyboard()
input()
A magic number is:
a number that is mathematically undefined
an unexplained value that appears in program's code
a number that cannot be divided by 1
a number that causes computers to crash
A ____ is a name that represents a value that cannot be changed during the program's execution.
named literal
named constant
variable signature
key term
Programmers must be careful not to make syntax errors when writing pseudocode programs
True
False
In a math expression, multiplication and division take place before addition and subtraction.
True
False
Variable names can have spaces in them.
True
False
In Python the first character of a variable name cannot be a number.
True
False
If you print a variable that has not been assigned a value, the number 0 will be displayed
True
False
A _____ structure can execute a set of statements only under certain circumstances
sequence
circumstantial
decision
boolean
The structure that provides one alternative path of execution:
single alternative decision
sequence
one path alternative
single execution decision
A(n) ___ expression has a value of either true or false:
Boolean
binary
decision
unconditional
The symbols >, <, and == are all operators.
logical
conditional
ternary
relational
A(n) ___ structure tests a condition and then takes one path if true, and another if false.
dual alternative decision
sequence
If-Then statement
single alternative decision
You use a(n) ___ statement to write a single alternative decision structure.
test-jump
if
if-else
if-call
You use a(n) ___ statement to write a dual alternative decision structure.
test-jump
if
if-else
if-call
and, or, and not are operators.
relational
conditional
ternary
logical
A compound expression created with the ___ operator is true if both subexpressions are true.
OR
NOT
AND
BOTH
A Boolean expression created with the ___ operator is true if either subexpressions are true.
AND
EITHER
OR
NOT
The operator that takes a Boolean expression as its operand and reverses its logical value.
NOT
AND
OR
EITHER
This is a boolean variable that signals when some condition exists in the program.
flag
signal
sentinel
siren
You can write any program using only sequence structures.
True
False
A program can be made of only one type of control structure. You cannot combine structures.
True
False
Single alternative decision structure tests a condition, if true takes a path, or another path if false.
True
False
A decision structure can be nested inside another decision structure.
True
False
A Boolean expression created with the and operator is true only when both subexpressions are true.
True
False
A(n) ______ is a set of instructions that a computer follows to perform a task.
Compiler
Interpreter
Program
Programming Language
The physical devices that a computer is made of are referred to as
hardware
software
the operating system
tools
The part of a computer that runs programs is called
RAM
secondary storage
main memory
the CPU
Today, CPUs are small chips known as
ENIAC's
Microprocessors
Memory chips
Operating systems
The computer stores a program while the program is running, as well as the data that the program is working with, in ___
secondary
the CPU
main memory
the microprocessor
This volatile type of memory that is used only for temporary storage while a program is running
RAM
Secondary storage
The disk drive
The USB drive
A type of memory that can hold data for long periods of time, even when there is no power
RAM
Main memory
Secondary storage
CPU storage
A component that collects data from people or other devices and sends it to the computer is called ___
an output device
an input device
a secondary storage device
main memory
A video display is a(n) ____ device.
output
input
secondary storage
main memory
A ____ is enough memory to store a letter of the alphabet or a small number.
byte
switch
transistor
bit
A byte is made up of eight ____.
CPUs
addresses
variables
bits
In the ____ numbering system, all numeric values are written as sequences of 0s and 1s.
Hexadecimal
Binary
Octal
Decimal
A bit that is turned off represents the following value.
1
-1
0
No
A set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters is ____.
binary numbering
ASCII
ENIAC
Unicode
An extensive encoding scheme that can represent characters for many languages in the world is ____.
binary numbering
ASCII
Unicode
ENIAC
Negative numbers are encoded using the ____ technique.
two's complement
floating point
ASCII
Unicode
Real numbers are encoded using the ______ technique.
Unicode
floating point
ASCII
two's complement
The tiny dots of color that digital images are composed of are called ______.
bits
bytes
color packets
pixels
If you were to look at a machine language program, you would see ______.
Python code
stream of binary numbers
English words
circuits
In the ______ part of the fetch-decode-execute cycle, the CPU determines which operation it should perform.
execute
deconstruct
fetch
decode
Computers can only execute programs written in ______.
Machine Language
translator
Assembly Language
C#
The ______ translates an assembly language program to a machine language.
Assembler
Compiler
Interpreter
Translator
The words that make up a high level programming language are called ______.
Binary instructions
Mnemonics
Commands
Key words
The rules that must be followed when writing a program are called _____
Syntax
Punctuation
Key words
Operators
A(n) ___ program translates a high-level language program into a separate machine program.
assembler
compiler
translator
operators
Today, CPUs are huge devices made of electrical and mechanical components such as vacuum tubes and switches.
True
False
Main memory is also known as RAM.
True
False
Any piece of data that is stored in a computer’s memory must be stored as a binary number.
True
False
Images, like the ones created with your digital camera, cannot be stored as binary numbers.
True
False
Machine language is the only language that a CPU understands.
True
False
Assembly language is considered a high-level language.
True
False
An interpreter is a program that both translates and executes the instructions of a program.
True
False
A syntax error does not prevent a program from being compiled and executed.
True
False
Windows, Linux, Android, iOS, and macOS are all examples of application software.
True
False
Word processing, spreadsheet, email, web browsers, and games are all examples of utility programs.
True
False
