Computer and Python Basics
- 84Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
84 questions
- 1The course’s central goal of learning how to apply computation to solve problems is called_____.
Hint
Think of a way to approach problems that uses computation rather than relying only on manual or mathematical methods.
Answer
computational thinking
Explanation
Computational thinking means considering how computation can help solve a problem, including problems that might also be approached mathematically or by brute force.
- 2To turn a problem described in English into a program, students first identify applicable computer science_____and then implement them in code.
Hint
These are the ideas and methods learned in computer science that can be applied to a problem.
Answer
Concepts
Explanation
Problem solving involves moving from an English description to relevant computer science concepts, and then using those concepts to write a program.
- 3The three broad outcomes of the class are knowledge of concepts, programming skill, and_____.
Hint
This outcome involves working out how to transform a described problem into a computational solution.
Answer
problem solving
Explanation
The class aims to build knowledge of concepts, programming skill, and problem-solving skills.
- 4Lectures and exams primarily support or assess students’ knowledge of_____.
Hint
This is the understanding of computer science ideas and principles.
Answer
Concepts
Explanation
Lectures and exams help students gain and demonstrate knowledge of concepts.
- 5The course’s short programming practice activities are intended to develop_____.
Hint
These improve by actively writing code rather than only watching someone else code.
Answer
programming skills
Explanation
Finger exercises give students practice that develops programming skills.
- 6Problem sets are designed especially to develop students’_____.
Hint
This skill includes figuring out how to apply concepts to a problem and then program a solution.
Answer
problem solving
Explanation
Problem sets help students practice solving problems by connecting descriptions, computer science concepts, and programming.
- 7Because programming is a skill, students need to_____it regularly rather than only watch code being written.
Hint
Think of an activity that becomes more familiar through repeated use.
Answer
practice
Explanation
Programming skill develops through frequent practice; simply watching code being typed does not provide the same experience.
- 8A goal of organizing code is to make it neat, readable, and_____.
Hint
This describes code divided into organized parts rather than left as one large, undifferentiated block.
Answer
modular
Explanation
The course introduces ways to structure code so that it is neat, readable, and modular.
- 9A statement that expresses a fact, such as describing what a square root is, is an example of_____knowledge.
Hint
This kind of knowledge says what is true, rather than giving instructions for how to do something.
Answer
declarative
Explanation
Declarative knowledge is a statement of fact. It describes a relationship but does not necessarily tell a computer how to find an answer.
- 10A set of instructions that explains how to do something is_____knowledge.
Hint
This kind of knowledge gives a procedure or recipe to follow.
Answer
imperative
Explanation
Imperative knowledge specifies a sequence of actions for carrying out a task.
- 11When programming, people write a_____for the computer to follow.
Hint
The lecture compares program instructions to directions for completing a task.
Answer
recipe
Explanation
A program gives the computer a recipe: instructions that tell it what to do.
- 12The square root of an input can be characterized as a value whose square equals the_____.
Hint
This is the number for which the square root is being found.
Answer
input
Explanation
The declarative description says that the square root of a number is a value whose square equals that number.
- 13An algorithm is a_____of steps for solving a problem.
Hint
The steps are arranged in an order that the computer can follow.
Answer
sequence
Explanation
An algorithm consists of an ordered sequence of steps that carries out a task.
- 14An instruction to perform a step again introduces_____into an algorithm’s flow of control.
Hint
This control pattern returns to an earlier step instead of continuing only once.
Answer
repetition
Explanation
Repeating steps is a form of flow control that allows an algorithm to perform an action multiple times.
- 15An algorithm needs a way to_____so that it does not continue forever.
Hint
This is the endpoint of a procedure, often reached once a condition is satisfied.
Answer
stop
Explanation
A stopping rule defines when an algorithm is finished and prevents it from running indefinitely.
- 16In the square-root procedure, the computer begins with an initial_____.
Hint
The procedure improves this estimate rather than knowing the answer in advance.
Answer
guess
Explanation
The square-root algorithm starts with a guess and then refines it through repeated steps.
- 17To improve a square-root guess, the procedure averages the current guess with the input divided by the current_____.
Hint
The same estimate appears both by itself and in the denominator of the other quantity being averaged.
Answer
guess
Explanation
The update step averages the guess with the input divided by that guess to produce a new estimate.
- 18The square-root procedure repeats its update until the guess is sufficiently close to the actual_____.
Hint
This is the value the algorithm is trying to estimate.
Answer
answer
Explanation
The algorithm stops when its estimate meets the chosen closeness requirement; a stricter requirement means continuing for more steps.
- 19A baking recipe illustrates an algorithm because it has ordered steps, flow of control, and a way to_____.
Hint
For example, a cake is taken out when a toothpick comes out clean.
Answer
stop
Explanation
Recipes can include sequences, conditional choices, repetition, and stopping conditions, just like algorithms.
- 20When given an algorithm, a computer follows the instructions rather than making decisions on its own; it does what it is_____.
Hint
The computer acts according to the instructions supplied by the programmer.
Answer
told to do
Explanation
Computers do not independently decide what task to perform. They execute the instructions they are given.
- 21Compared with people, computers are especially good at storing large amounts of_____and performing operations quickly.
Hint
This includes information kept in memory or storage, such as files and values.
Answer
data
Explanation
The lecture emphasizes computers’ ability to store lots of data and perform operations very quickly.
- 22A pocket calculator illustrates a_____program computer because its available operations are built into its buttons.
Hint
Its operations are predetermined rather than saved as a reusable, changeable program.
Answer
fixed
Explanation
A fixed program computer has a set of built-in operations, as illustrated by a pocket calculator.
- 23With a fixed program calculator, a user generally has to enter the operation sequence again for each new set of_____.
Hint
These are the values supplied to the operation sequence.
Answer
inputs
Explanation
The calculator does not store an operation sequence for later reuse with different inputs, so the user must enter the sequence again.
- 24Stored-program computers can keep instructions to perform tasks as_____.
Hint
The instructions are represented in a form that can be stored in computer memory.
Answer
data
Explanation
Stored-program computers store instructions as data so that programs can be kept and executed.
- 25A special program that executes stored instructions is an_____.
Hint
It follows the program’s instructions, including instructions to move to another location.
Answer
interpreter
Explanation
An interpreter executes instructions by following their specified operations and control flow.
- 26Basic stored-program instructions include arithmetic, logical tests, and moving_____.
Hint
For example, an instruction can transfer a value from one memory location to another.
Answer
data
Explanation
The lecture describes arithmetic operations, logical tests such as equality checks, and moving data as basic instruction types.
- 27The component that performs arithmetic and comparison operations is the arithmetic logic unit, abbreviated_____.
Hint
Its name combines the words arithmetic and logic.
Answer
ALU
Explanation
The ALU carries out operations such as addition, subtraction, multiplication, and comparisons.
- 28The computer component associated with the program counter and program execution is the_____unit.
Hint
It directs the operation of the computer and tracks which instruction is to be executed.
Answer
control
Explanation
The control unit manages program execution; the program counter is associated with it.
- 29In the lecture’s memory example, the ALU sends a computed result back, and a separate instruction may then_____it at a specified memory location.
Hint
The result does not automatically go to a lasting location unless the program instructs the computer to do this.
Answer
store
Explanation
The ALU performs the operation, while a store instruction specifies where the resulting value is placed in memory.
- 30A comparison instruction can ask whether two values in memory are_____to each other.
Hint
The example compares two values and determines whether they are the same.
Answer
equivalent
Explanation
Logical instructions can test equality between values; the result can then be used or printed.
- 31The Turing-machine primitives described in the lecture include moving the tape left or right, reading, writing, erasing, and doing no_____.
Hint
This last primitive leaves the tape unchanged for that step.
Answer
operation
Explanation
The six listed primitives are moving the tape left, moving it right, reading a value, putting a value on the tape, erasing a value, and no operation.
- 32The lecture’s result about programming languages is that anything computable in one language is computable in_____.
Hint
The result concerns the ability to express computations across different languages.
Answer
any other programming language
Explanation
Although languages can differ in convenience and syntax, a computation possible in one programming language can be built in another.
- 33Numbers, sequences of characters, and operators are examples of programming-language_____.
Hint
These are basic elements used to build more complex expressions and programs.
Answer
primitives
Explanation
Programming languages provide primitive elements, such as numbers, character sequences, and operators, from which programs are constructed.
- 34In the lecture’s English analogy, words can be combined into sentences, and sentences can be combined into_____.
Hint
This is a larger unit built from sentences in the analogy.
Answer
stories
Explanation
The analogy describes building characters into words, words into sentences, and sentences into stories.
- 35A combination such as noun, verb, noun is an example of a syntactically valid English_____.
Hint
Syntax concerns whether elements are arranged according to grammatical rules.
Answer
sentence
Explanation
The lecture contrasts a grammatical noun–verb–noun construction with an invalid sequence such as noun, noun, noun.
- 36Putting two objects side by side without an operator between them can be syntactically invalid in Python; a valid expression generally needs object, operator, and_____.
Hint
The operator connects two elements in this basic expression pattern.
Answer
object
Explanation
Python expressions commonly place an operator between objects; simply placing two objects next to each other does not specify a valid operation.
- 37In Python, placing the multiplication operator between a string and an integer repeats the_____.
Hint
The character sequence is produced multiple times according to the integer value.
Answer
string
Explanation
A string multiplied by an integer repeats that string the specified number of times.
- 38An expression can be syntactically valid but still have a static semantic error if its operation has no meaningful_____.
Hint
Syntax checks form; static semantics checks whether the operation makes sense for the objects involved.
Answer
meaning
Explanation
For example, the lecture describes adding a number to a string as having valid object-operator-object form but no defined meaning in Python.
- 39Spelling and indentation mistakes are examples of_____errors.
Hint
These errors violate the rules for how code must be written.
Answer
syntactic
Explanation
Syntactic errors include code-writing mistakes such as misspellings and incorrect indentation.
- 40Unlike ambiguous sentences in English, a program’s instructions have only one meaning to the computer because it follows them_____.
Hint
The computer does not choose among several possible interpretations of the instructions.
Answer
exactly
Explanation
A computer executes program instructions according to their defined behavior, so the program itself is not ambiguous to the machine.
- 41A program can execute without a syntax error yet still fail to do what its programmer intended; this is a problem with its_____.
Hint
This concerns what the program actually means or does, rather than its written form.
Answer
semantics
Explanation
A program’s actual behavior can differ from the programmer’s intended meaning, producing a crash, an endless run, or an incorrect answer.
- 42At its core, programming involves creating objects and_____them.
Hint
This means performing operations on the objects to achieve a result.
Answer
manipulating
Explanation
Programs create objects and manipulate them through operations supported by their types.
- 43An object’s_____tells Python which operations are allowed for that object.
Hint
For example, numbers and sequences of characters support different operations.
Answer
type
Explanation
Python uses an object’s type to determine what can validly be done with it.
- 44A whole-number object such as five or negative one hundred has the Python type_____.
Hint
This type represents whole numbers rather than numbers written with a decimal point.
Answer
integer
Explanation
Integers represent whole-number values, including positive and negative values.
- 45A number written with a decimal point, such as 2.0, has the Python type_____.
Hint
This type represents numbers such as 3.27 and negative 3.14159.
Answer
float
Explanation
Python treats a value such as 2.0 as a float, even though it represents the same numerical quantity as two.
- 46The Python type that represents truth values is called a_____.
Hint
It has two possible values, which indicate whether a condition is true or false.
Answer
Boolean
Explanation
A Boolean represents truth values and has only the values True and False.
- 47Python’s Boolean values are written with capitalized names:_____
Trueand.Hint
The first letter of this value is capitalized in Python.
Answer
False
Explanation
Capitalization matters in Python: the Boolean values are
TrueandFalse; lowercasetrueis not the same name. - 48The special value belonging to Python’s None type is_____.
Hint
It is a single special value, not one of a pair like the Boolean values.
Answer
None
Explanation
The None type has only one value, written
None. - 49A number by itself is a scalar object, whereas a list of numbers is a_____object because it has internal structure.
Hint
This category includes objects made up of multiple organized elements.
Answer
non-scalar
Explanation
Non-scalar objects have structure, such as a list with elements at different positions; a single number has no such internal structure.
- 50A string is a sequence of_____enclosed in quotation marks.
Hint
These can include letters and other symbols arranged in order.
Answer
characters
Explanation
Quotation marks tell Python that the enclosed sequence is a string made up of characters.
- 51For a string, useful operations include finding a character’s position and determining the sequence’s_____.
Hint
This tells how many characters the sequence contains.
Answer
length
Explanation
String operations can identify characters at positions and determine how many characters the string contains.
- 52To ask Python for the type of an object, use the_____
type.Hint
It is written with the object inside parentheses.
Answer
command
Explanation
The
typecommand reports an object’s type, such as integer or float. - 53Casting an integer to a float creates a new object rather than changing the original object in_____.
Hint
The original integer remains present after the converted value is created.
Answer
memory
Explanation
Casting produces a new object of the requested type; it does not alter the already-created object.
- 54Converting a float such as 5.9 to an integer with_____
intremoves the fractional part by, rather than rounding.Hint
The decimal portion is discarded rather than used to select the nearest whole number.
Answer
truncating
Explanation
The
intconversion keeps the integer portion of a float; it does not round the value. - 55The result of_____
float(3)is a float representation of the integer, written.Hint
The converted value includes a decimal point.
Answer
3.0
Explanation
Casting the integer three to a float creates the value
3.0. - 56Python evaluates an expression to one value and stores the result, rather than storing the unevaluated_____.
Hint
This is the combination of objects and operators before evaluation.
Answer
expression
Explanation
When Python evaluates an expression, it computes a single result value; it does not retain the expression itself as the stored result.
- 57In the expression_____
3 + 2, the result is the value.Hint
Apply the addition operation to the two integer objects.
Answer
5
Explanation
Python evaluates the addition and produces the integer value five.
- 58Adding, subtracting, or multiplying two integers produces an integer_____.
Hint
This is the type of the value produced by those operations when both operands are integers.
Answer
result
Explanation
For addition, subtraction, and multiplication, two integer operands yield an integer result.
- 59For addition, subtraction, or multiplication, if at least one operand is a float, the result is a_____.
Hint
The result uses the decimal-number type when one of these operations combines integers and floats.
Answer
float
Explanation
The lecture’s rule is that these operations produce a float if one or both operands are floats.
- 60In Python, ordinary division using_____
/always produces a.Hint
This is true even when the quotient is a whole number.
Answer
float
Explanation
Python’s division operator
/returns a float regardless of the operand types. - 61The_____
//operator performs floor division, giving the integer portion of the.Hint
For example, five floor-divided by three gives one.
Answer
division
Explanation
Floor division discards the fractional part of the quotient, as in five divided by three yielding one with
//. - 62The_____
%operator returns theleft over after division.Hint
For example, dividing five by three leaves two of these.
Answer
remainder
Explanation
The modulo operator
%gives the remainder from division. - 63Python uses_____
**to represent raising a number to a power, also called.Hint
For example, two raised to the third power is eight.
Answer
exponentiation
Explanation
The double asterisk operator performs exponentiation in Python.
- 64When an integer and a float are used with floor division, modulo, or exponentiation, a float operand makes the result a_____.
Hint
The result type follows the rule described for these numeric operations when a float is involved.
Answer
float
Explanation
For floor division, modulo, and exponentiation, the lecture describes the result as a float if an operand is a float.
- 65Among the arithmetic operators discussed, exponentiation has higher precedence than multiplication and_____.
Hint
These two operators share the next precedence level with the remainder operator.
Answer
division
Explanation
The precedence order places exponentiation first, then multiplication, division, and modulo, followed by addition and subtraction.
- 66Parentheses can be used to override the usual operator_____.
Hint
This determines which operation is evaluated first.
Answer
precedence
Explanation
Parentheses control evaluation order when the default precedence rules would produce a different order.
- 67When a command contains a computation inside its parentheses, Python evaluates the inside computation first and then works_____.
Hint
Think of evaluating nested calls from the innermost part toward the enclosing command.
Answer
outward
Explanation
For nested commands, Python evaluates the contents of the parentheses and then uses the result in the surrounding command.
- 68The type of_____
4 * 3is integer, while the type of4.0 * 3is.Hint
One of the operands in the second expression is written with a decimal point.
Answer
float
Explanation
Multiplying an integer by a float produces a float result.
- 69The value of_____
int(1 / 2)is zero because division first produces 0.5 and integer conversion then.Hint
The conversion discards the fractional part instead of rounding to the nearest integer.
Answer
truncates
Explanation
Division produces a float, and
intremoves its fractional portion, so converting 0.5 gives zero. - 70A variable name lets a program refer to a value without repeatedly copying a long value such as an approximation of_____.
Hint
This mathematical constant can be represented by a long decimal value.
Answer
pi
Explanation
Giving a long value a variable name makes code easier to write and read, and avoids repeatedly copying the value.
- 71In an assignment statement, Python evaluates the_____side before binding the result to the variable on the left.
Hint
This side contains the value or expression to be assigned.
Answer
right
Explanation
The assignment process evaluates the right-hand side to one value, then binds that value to the name on the left.
- 72In Python, the equal sign in an assignment statement is an assignment operator, not a test of_____.
Hint
It does not ask whether two expressions have the same value.
Answer
equality
Explanation
Assignment binds a variable name to a value; it is not a mathematical equation or an equality test.
- 73A basic assignment statement has one variable on the left and a value or expression on the_____side.
Hint
This side is evaluated before the binding is made.
Answer
right
Explanation
In the assignment model discussed, one variable name is bound to the value obtained from the right-hand side.
- 74When a variable is rebound, its previous_____to a value is replaced by a new one.
Hint
This is the association between a variable name and an object.
Answer
binding
Explanation
Rebinding changes which value a variable name refers to; it does not change the old object itself.
- 75After_____
radiusis rebound from 2.2 to 3.2, a previously calculatedareadoes not change unless the program explicitlyit again.Hint
Changing an input variable does not automatically update a derived value.
Answer
calculates
Explanation
Python follows the statements given to it. It does not infer that an earlier calculation should be repeated after a variable changes.
- 76A program that has only ordinary sequential statements executes them one after another, line by_____.
Hint
The computer starts at the top and proceeds through the program’s statements in order.
Answer
line
Explanation
Without control-flow instructions, the program executes each line in sequence and does not automatically skip or repeat lines.
- 77Using descriptive variable names makes code easier for the original programmer and other people to_____.
Hint
Good names help people understand what values represent when they revisit the program.
Answer
read
Explanation
Meaningful variable names make programs more legible and easier to understand than unexplained single-letter names.
- 78In Python, a line beginning with_____
#introduces a.Hint
This is explanatory text for people, not an instruction that performs a calculation.
Answer
comment
Explanation
Comments begin with a hash mark and help readers understand the purpose of code.
- 79A useful comment often explains the purpose of a chunk of code rather than merely restating each_____.
Hint
The comment should add context that is not obvious from reading the statement itself.
Answer
line
Explanation
Comments are most helpful when they explain a larger section or its purpose, rather than translating each code statement into words.
- 80When swapping two variable values without directly writing their final values, a safe method uses a third temporary_____.
Hint
It preserves one of the original values while the other names are reassigned.
Answer
variable
Explanation
A temporary variable stores one original value so that it is not lost during the swap.
- 81In the swap procedure, the temporary variable should first be assigned one of the original values of_____
xor.Hint
These are the two variables whose values are being exchanged.
Answer
y
Explanation
Saving either original value in a temporary variable allows the other variable to be reassigned without losing information.
- 82The Python shell is useful for quickly checking a command without first writing and running a whole_____.
Hint
It can evaluate a short expression or command directly.
Answer
program
Explanation
The shell allows quick experiments and checks before incorporating code into a larger program.
- 83Python Tutor helps with debugging by letting students step through code and inspect variable_____after each line.
Hint
These show what is currently associated with each variable during execution.
Answer
values
Explanation
Stepping through a program makes it possible to see how variable values change from one executed line to the next.
- 84If code does not behave as expected, students can redefine variables and try the experiment again in the_____.
Hint
This interactive environment is used for quick tests and commands.
Answer
shell
Explanation
The shell supports trying short pieces of code again, which is useful when correcting mistakes or testing an idea.

Ask anything
We've read this whole study set, so questions about it get the best answers.