Compsci Vocab: Control State

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/90

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

91 Terms

1
New cards

Bug

An error in a program.

2
New cards

CPU

The heart of any computer. It is what runs the software that we write; also called “CPU” or “the processor”.

3
New cards

Compile

To translate a program written in a high-level language into a low-level language all at once, in preparation for later execution.

4
New cards

High-Level Launguage

A programming language like Python that is designed to be easy for humans to read and write.

5
New cards

Interactive Mode

A way of using the Python interpreter by typing commands and expressions at the prompt.

6
New cards

Interpret

To execute a program in a high-level language by translating it one line at a time.

7
New cards

Low-Level Language

A programming language that is designed to be easy for a computer to execute; also called “machine code” or “assembly language”.

8
New cards

Machine Code

The lowest-level language for software, which is the language that is directly executed by the central processing unit (CPU).

9
New cards

Main Memory

Stores programs and data. Main memory loses its information when the power is turned off.

10
New cards

Parse

To examine a program and analyze the syntactic structure.

11
New cards

Portability

A property of a program that can run on more than one kind of computer.

12
New cards

Print Function

An instruction that causes the Python interpreter to display a value on the screen.

13
New cards

Problem Solving

The process of formulating a problem, finding a solution, and expressing the solution.

14
New cards

Program

A set of instructions that specifies a computation.

15
New cards

Prompt

When a program displays a message and pauses for the user to type some input to the program.

16
New cards

Secondary Memory

Stores programs and data and retains its information even when the power is turned off. Generally slower than main memory. Examples of secondary memory include disk drives and flash memory in USB sticks.

17
New cards

Semantics

The meaning of a program.

18
New cards

Semantic Error

An error in a program that makes it do something other than what the programmer intended.

19
New cards

Source Code

A program in a high-level language

20
New cards

Assignment

A statement that assigns a value to a variable

21
New cards

Concatenate

To join two operands end to end.

22
New cards

Comment

Information in a program that is meant for other programmers (or anyone reading the source code) and has no effect on the execution of the program.

23
New cards

Evaluate

To simplify an expression by performing the operations in order to yield a single value.

24
New cards

Expression

A combination of variables, operators, and values that represents a single result value.

25
New cards

Floating Point

A type that represents numbers with fractional parts.

26
New cards

Integer

A type that represents whole numbers.

27
New cards

Keyword

A reserved word that is used by the compiler to parse a program; you cannot use keywords like if, def, and while as variable names.

28
New cards

Mnemonic

A memory aid. We often give variables mnemonic names to help us remember what is stored in the variable.

29
New cards

Modulus Operator

An operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another.

30
New cards

Operand

One of the values on which an operator operates.

31
New cards

Operator

A special symbol that represents a simple computation like addition, multiplication, or string concatenation

32
New cards

Rules of Precedence

The set of rules governing the order in which expressions involving multiple operators and operands are evaluated.

33
New cards

Statement

A section of code that represents a command or action. So far, the statements we have seen are assignments and print expression statement.

34
New cards

String

A type that represents sequences of characters.

35
New cards

Type

A category of values. The types we have seen so far are integers (type int), floating-point numbers (type float), and strings (type str).

36
New cards

Value

One of the basic units of data, like a number or string, that a program manipulates.

37
New cards

Variable

A name that refers to a value.

38
New cards

Algorithm

A general process for solving a category of problems.

39
New cards

Argument

A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function.

40
New cards

Function Body

The sequence of statements inside a function definition.

41
New cards

Composition

Using an expression as part of a larger expression, or a statement as part of a larger statement.

42
New cards

Deterministic

Pertaining to a program that does the same thing each time it runs given the same inputs.

43
New cards

Dot Notation

The syntax for calling a function in another module by specifying the module name followed by a dot (period) and the function name.

44
New cards

Flow or Execution

The order in which statements are executed during a program run.

45
New cards

Fruitful Function

A function that returns a value.

46
New cards

Function

A named sequence of statements that performs some useful operation. Functions may or may not take arguments and may or may not return a value.

47
New cards

Function Call

A statement that executes a function. It consists of the function name followed by an argument list.

48
New cards

Function Object

A value created by a function definition. The name of the function is a variable that refers to a function object.

49
New cards

Header

The first line of a function definition.

50
New cards

Import Statement

A statement that reads a module file and creates a module object.

51
New cards

Module Object

A value created by an import statement that provides access to the data and code defined in a module.

52
New cards

Parameter

A name used inside a function to refer to the value passed as an argument.

53
New cards

Pseudorandom

Pertaining to a sequence of numbers that appear to be random, but are generated by a deterministic program.

54
New cards

Return Value

The result of a function. If a function call is used as an expression, the return value is the value of the expression.

55
New cards

Void Function

A function that does not have a return value.

56
New cards

Body

The sequence of statements within a compound statement.

57
New cards

Boolean Expression

An expression whose value is either True or False.

58
New cards

Branch

One of the alternative sequences of statements in a conditional statement.

59
New cards

Chained Conditional

A conditional statement with a series of alternative branches.

60
New cards

Comparison Operator

One of the operators that compares its operands: ==, !=, >, <, >=, and <=.

61
New cards

Conditional Statement

A statement that controls the flow of execution depending on some condition.

62
New cards

Condition

The boolean expression in a conditional statement that determines which branch is executed.

63
New cards

Compound Statement

A statement that consists of a header and a body. The header ends with a colon (:). The body is indented relative to the header.

64
New cards

Guardian Pattern

Where we construct a logical expression with additional comparisons to take advantage of the short-circuit behavior.

65
New cards

Logical Operator

One of the operators that combines boolean expressions: and, or, and not.

66
New cards

Nested Conditional

A conditional statement that appears in one of the branches of another conditional statement.

67
New cards

Traceback

A list of the functions that are executing, printed when an exception occurs.

68
New cards

Short Circuit

When Python is part-way through evaluating a logical expression and stops the evaluation because Python knows the final value for the expression without needing to evaluate the rest of the expression.

69
New cards

Accumulator

A variable used in a loop to add up or accumulate a result.

70
New cards

Loop Counter

A variable used in a loop to count the number of times something happened. We initialize a counter to zero then increment the counter each time we want to “count” something.

71
New cards

Decrement

To decrease the value of a variable (often by one).

72
New cards

Initialize

To give an initial value to a variable that will be updated.

73
New cards

Infinite Loop

A loop in which the terminating condition is never satisfied or for which there is no terminating condition.

74
New cards

Iteration

One repeated execution of a set of statements using either a function that calls itself or a loop.

75
New cards

Increment

To increase the value of a variable (often by one).

76
New cards

Counter

A variable used to count something. It’s usually initialized to zero and then incremented.

77
New cards

Empty String

A string with no characters and length 0, represented by two quotation marks.

78
New cards

Format Operator

An operator, %, that takes a format string and a tuple and generates a string that includes the elements of the tuple formatted as specified by the format string.

79
New cards

Format Sequence

A sequence of characters in a format string, like %d, that specifies how a value should be formatted.

80
New cards

Format String

A string, used with the format operator, that contains format sequences.

81
New cards

Flag

A boolean variable used to indicate whether a condition is true or false.

82
New cards

Invocation

A statement that calls a method.

83
New cards

Immutable

A property of sequences whose items cannot be reassigned.

84
New cards

String Index

An integer value used to select a character in a string.

85
New cards

Item

One of the values in a sequence.

86
New cards

Method

A function that is associated with an object and called using dot notation.

87
New cards

String Object

A string that a variable can refer to. For now, you can use “object” and “value” interchangeably.

88
New cards

Search

A pattern of traversal that stops when it finds what it is looking for.

89
New cards

Sequence

An ordered set; that is, a set of values where each value is identified by an integer index

90
New cards

Slice

A part of a string specified by a range of indicies.

91
New cards

Traverse

To iterate through the items in a sequence, performing a similar operation on each.