1. Home
  2. Explore
  3. Computer Science
  4. Computer and Python Basics

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Computer and Python Basics

  • 84Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Computational Thinking
The course’s central goal of learning how to apply computation to solve problems is called
.

84 questions

  1. 1
    The 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.

  2. 2
    To 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.

  3. 3
    The 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.

  4. 4
    Lectures 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.

  5. 5
    The 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.

  6. 6
    Problem 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.

  7. 7
    Because 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.

  8. 8
    A 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.

  9. 9
    A 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.

  10. 10
    A 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.

  11. 11
    When 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.

  12. 12
    The 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.

  13. 13
    An 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.

  14. 14
    An 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.

  15. 15
    An 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.

  16. 16
    In 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.

  17. 17
    To 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.

  18. 18
    The 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.

  19. 19
    A 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.

  20. 20
    When 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.

  21. 21
    Compared 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.

  22. 22
    A 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.

  23. 23
    With 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.

  24. 24
    Stored-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.

  25. 25
    A 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.

  26. 26
    Basic 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.

  27. 27
    The 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.

  28. 28
    The 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.

  29. 29
    In 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.

  30. 30
    A 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.

  31. 31
    The 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.

  32. 32
    The 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.

  33. 33
    Numbers, 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.

  34. 34
    In 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.

  35. 35
    A 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.

  36. 36
    Putting 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.

  37. 37
    In 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.

  38. 38
    An 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.

  39. 39
    Spelling 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.

  40. 40
    Unlike 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.

  41. 41
    A 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.

  42. 42
    At 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.

  43. 43
    An 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.

  44. 44
    A 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.

  45. 45
    A 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.

  46. 46
    The 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.

  47. 47
    Python’s Boolean values are written with capitalized names: True and
    _____
    .
    Hint

    The first letter of this value is capitalized in Python.

    Answer

    False

    Explanation

    Capitalization matters in Python: the Boolean values are True and False; lowercase true is not the same name.

  48. 48
    The 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.

  49. 49
    A 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.

  50. 50
    A 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.

  51. 51
    For 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.

  52. 52
    To ask Python for the type of an object, use the type
    _____
    .
    Hint

    It is written with the object inside parentheses.

    Answer

    command

    Explanation

    The type command reports an object’s type, such as integer or float.

  53. 53
    Casting 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.

  54. 54
    Converting a float such as 5.9 to an integer with int removes 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 int conversion keeps the integer portion of a float; it does not round the value.

  55. 55
    The 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.

  56. 56
    Python 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.

  57. 57
    In 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.

  58. 58
    Adding, 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.

  59. 59
    For 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.

  60. 60
    In 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.

  61. 61
    The // 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 //.

  62. 62
    The % operator returns the
    _____
    left 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.

  63. 63
    Python 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.

  64. 64
    When 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.

  65. 65
    Among 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.

  66. 66
    Parentheses 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.

  67. 67
    When 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.

  68. 68
    The type of 4 * 3 is integer, while the type of 4.0 * 3 is
    _____
    .
    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.

  69. 69
    The 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 int removes its fractional portion, so converting 0.5 gives zero.

  70. 70
    A 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.

  71. 71
    In 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.

  72. 72
    In 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.

  73. 73
    A 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.

  74. 74
    When 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.

  75. 75
    After radius is rebound from 2.2 to 3.2, a previously calculated area does not change unless the program explicitly
    _____
    it 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.

  76. 76
    A 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.

  77. 77
    Using 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.

  78. 78
    In 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.

  79. 79
    A 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.

  80. 80
    When 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.

  81. 81
    In the swap procedure, the temporary variable should first be assigned one of the original values of x or
    _____
    .
    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.

  82. 82
    The 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.

  83. 83
    Python 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.

  84. 84
    If 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.

1 of 84
Question 1 of 84

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent