python exam 1 – Flashcards

Unlock all answers in this set

Unlock answers
question
Where does a computer store a program and the data that the program is working with while the program is running?
answer
Main memory
question
What is the encoding technique used to store positive and negative integers in the computer's memory?
answer
Two's-complement
question
How many different values can a single byte take?
answer
256
question
Which is a secondary storage device that has no moving parts, and is faster than a traditional disk drive?
answer
Solid state drive
question
The CPU is able to quickly access data stored in any location in secondary storage.
answer
False
question
The python language uses a compiler.
answer
False
question
The instruction set for a microprocessor is unique and is typically understood only by microprocessors of the same brand.
answer
True
question
How many different values can a single byte take?
answer
256
question
What term refers to all the physical devices that a computer is comprised of?
answer
hardware
question
Main memory is more commonly known as:
answer
RAM
question
Convert the following binary value to decimal: 1011011
answer
91
question
Which of the following is not an algorithm design technique?
answer
Machine code
question
What is an argument?
answer
Data passed to a function
question
Which of the following is not a data type in Python?
answer
loop
question
Which of the following is a valid assignment?
answer
a6 = 7 + 5
question
Which data type is returned by the input() function?
answer
str
question
Which type of error produces an incorrect result but does not prevent the program from running?
answer
logic
question
Which is the informal language that programmers use to create models of programs that have no syntax rules and are not meant to be compiled or executed?
answer
Pseudocode
question
After the execution of the pictured statement, what is the data type of the variable total? total = 5/2
answer
float
question
What is the name of the built-in function that is used to read a value that has been typed by the user on the keyboard?
answer
input()
question
True/False: In Python, mathematical expressions are evaluated from left to right, regardless of which operators are used.
answer
False
question
What does the pictured statement output? print(2.3+4.7)
answer
7.0
question
A _ is a name that represents a value stored in the computer's memory
answer
variable
question
When the + operator is used on two strings, what happens?
answer
The two strings are concatenated
question
The _ structure of a program is the logical design that controls the order in which the statements are executed.
answer
control
question
Multiple boolean expressions can be combined by using a _ operator.
answer
logical
question
Which logical operator(s) perform short-circuit evaluation? Select all that apply
answer
or, and
question
True/False: The Python language is not sensitive to indentation
answer
False
question
When using the [blank] operator, one or both subexpressions must be true for the compound expression to be true.
answer
or
question
Which of the following is the correct if clause to determine whether y is in the range 10 through 50?
answer
if y ; 10 and y ; 50:
question
True/False: The 'not' operator is a binary operator
answer
False
question
What is the result of the following expression, if x=5, y=3, and z=8? xx
answer
false
question
In Python, which symbol is used as the not-equal-to operator?
answer
!=
question
In flowchart, what is the symbol used for decision structure?
answer
diamond
question
A [blank] operator compares two values and determines whether a specific condition exists between them.
answer
relational
question
A Boolean variable is commonly referred to as a [blank] indicating whether a condition exists.
answer
flag
question
What is the structure that causes a statement (or a set of statements) to execute multiple times?
answer
Repetition structure
question
Which is the correct format for the while clause in Python?
answer
while condition :
question
Which is not an example of an augmented assignment operator?
answer
;=
question
What is printed during the final iteration of this loop? for num in range(4): print(num)
answer
3
question
What are the values generated by range(2, 9, 2)?
answer
2 4 6 8
question
In Python, a comma-separated sequence of values that are enclosed in a set of square brackets is called a:
answer
list
question
A while loop is known as a(n) [blank] loop because it tests the condition before performing an iteration.
answer
pretest
question
T/F: Both of the following for clauses would generate the same number of loop iterations: for num in range(4): for num in range(1, 5):
answer
True
question
The [blank] function is a built-in function that generates a sequence of integer values
answer
range()
question
When will the following loop terminate? while k != 999:
answer
When k refers to a value equal to 999
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New