programing definitions

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

1/196

flashcard set

Earn XP

Description and Tags

chapter 1-18

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

197 Terms

1
New cards

What is a rectangular block (typically with top and bottom notches) that performs some task?

function

2
New cards

What is the image associated with an object?

costume

3
New cards

In Scratch, what is an object that can appear on the stage?

sprite

4
New cards

In Scratch, what is a stack of blocks?

script

5
New cards

What is the category for the ask (__) and wait block?

sensing

6
New cards

While it is possible to make one type of loop handle any situation, certain types of loops are typically used for certain situations. What type of loop would be most appropriate for "Print ten rows"?

repeat

7
New cards

What block is used to concatenate two values and get a single string?

join

8
New cards

Which of the following (one or more) may appear at the beginning of a script

Looks/Events/Sound/Motion

9
New cards

hich of the following (one or more) may appear anywhere in a script?

Motion/Looks/Sound

10
New cards

What is the category for the if-then and if-then-else blocks?

control

11
New cards

A function that is run in response to an event is an event _____.

handler

12
New cards

An value that is either true/yes or false/no is what type (one word)?

boolean

13
New cards

What is the category for the say (___) block?

looks

14
New cards

What is the name of the block that converts a decimal number to an integer?

round

15
New cards

What is the category for the forever, repeat, and repeat-until blocks?

control

16
New cards

By creating our own blocks (functions), we can give a name to a set of statements (blocks). This name can describe at a "higher" level what is intended (like "inflate" or "deflate" for the balloon), rather than the low-level details of how something is done. What is this principle called?

abstraction

17
New cards

A _____ variable is visible to all sprites.

global

18
New cards

In Scratch, a sprite can make an announcement or send a message. What is the name of the block that does this?

broadcast

19
New cards

In software, a function will always be deterministic.

false

20
New cards

In computer programming, a function always returns a value.

false

21
New cards

A _____ variable is visible to only one sprite.

local

22
New cards

In software, a function can have side effects (that is, change the state of the world).

ture

23
New cards

In mathematics, a function always returns a value.

ture

24
New cards

What is the name given to a container for (or reference to) a value that can be used later in a program?

variable

25
New cards

An operator, such as '+' is simply syntactic sugar for a function.

true

26
New cards

In mathematics, a function can have side effects (that is, change the state of the world).

false

27
New cards

In mathematics, a function will always be deterministic.

true

28
New cards

An if-then block allows a script to ______ code if a boolean expression evaluates to false.

skip

29
New cards

Write an expression that converts the value 6 to a(n) str.

str(6)

30
New cards

a category of values such as int float or str

type

31
New cards

a named sequence of statements that can be called to perform some useful operation

function

32
New cards

a type that represents numbers with fractional parts

floating point

33
New cards

an operator // that divides two numbers and rounds down to an integer

integer division

34
New cards

a combination of variables values and operators

expression

35
New cards

A symbol, like + and *, that denotes an arithmetic operation like addition or multiplication.

arithmetic operator

36
New cards

A type that represents sequences of characters.

string

37
New cards

Any of the languages that people speak that evolved naturally.

natural language

38
New cards

Any of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer programs.

formal language

39
New cards

An error in a program that makes it impossible to parse—and therefore impossible to run.

syntax error

40
New cards

Joining two strings end-to-end.

concatenation

41
New cards

The process of finding and correcting errors

debugging

42
New cards

An integer, floating-point number, or string—or one of other kinds of values we will see later.

value

43
New cards

A defect in a program.

bug

44
New cards

A type that represents whole numbers and their negative counterparts.

integer

45
New cards

An expression—or part of an expression—that executes a function

function call

46
New cards

One of the values on which an operator operates

operand

47
New cards
48
New cards

What type of error is the following?

days = hours * 24

semantic error

49
New cards

What type of error is the following?

x = 3 / 0

runtime error

50
New cards

What type of error is the following?

my-var = 42

syntax error

51
New cards

A value provided to a function when the function is called.

argument

52
New cards

A statement that assigns a value to a variable.

assignment

53
New cards

A reserved word used to specify a part of the command structure of a program.

keyword

54
New cards

A(n) _______ error causes a program to display an error message and exit.

runtime

55
New cards

A graphical representation of a set of variables and the values they refer to.

state diagram

56
New cards

Perform the operations in an expression in order to compute a value.

evaluate

57
New cards

A(n) _______ error causes a program to do the wrong thing, but not to display an error message.

semantic

58
New cards

Run a statement and do what it says.

execute

59
New cards

A name that refers to a value

variable

60
New cards

The operator used to access a function or variable in another module

dot operator

61
New cards

Text included in a program that provides information about the program but has no effect on its execution.

comment

62
New cards

A file that contains Python code, including function definitions and sometimes other statements

module

63
New cards

One or more lines of code that represent a command or action.

statement

64
New cards

Another word for a runtime error.

exception

65
New cards

A statement that reads a module file so we can use the variables and functions it contains.

import

66
New cards

Which of the following are valid variable names?

myAge/average/student

67
New cards

A function ___________ or signature is the first line of code of the function.

header

68
New cards

Function Characteristics

Check all statements that are true.

If each function is only called once, using functions will actually increase the total number of lines of code./Using functions will typically increase the overall readability of code.

69
New cards

In Python, __________ help to perform problem decomposition and abstraction in our programs.

functions

70
New cards

Functions reduce _____________, making it easier to test and fix our code since a change needs to be made in only one place.

duplication

71
New cards

Problem decomposition involves breaking a large problem into __________ tasks.

smaller

72
New cards

The ____ keyword is used to tell Python that what follows is a function definition.

def

73
New cards

A statement that runs one or more statements, often repeatedly.

loop

74
New cards

An argument that includes the name of the parameter

keyword argument

75
New cards

A statement that creates a function.

function definition

76
New cards

The process of transforming a sequence of statements into a function definition

encapsulation

77
New cards

A string enclosed in triple quotes that can span more than one line of a program.

multiline string

78
New cards

A window used to display graphical elements including lines, circles, rectangles, and other shapes.

canvas

79
New cards

A process for writing programs

development plan

80
New cards

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

parameter

81
New cards

The first line of a function definition.

header

82
New cards

A requirement that should be satisfied by the caller before a function starts

precondition

83
New cards

A process for designing the interface of a function, which includes the parameters it should take.

interface design

84
New cards

The process of replacing something unnecessarily specific (like a number) with something appropriately general (like a variable or parameter).

generalization

85
New cards

A string that appears at the top of a function definition to document the function's interface.

docstring

86
New cards

The sequence of statements inside a function definition.

body

87
New cards

A variable defined inside a function, and which can only be accessed inside the function

local variable

88
New cards

The process of modifying a working program to improve function interfaces and other qualities of the code.

refactoring

89
New cards

A requirement that should be satisfied by the function before it ends

postcondition

90
New cards

A value created by a function definition

function object

91
New cards

We get a function to do its work by calling it with values (also called ___________) that are assigned to its parameters.

arguments

92
New cards

·         One or more statements indented to indicate they are part of another statement.

Block

93
New cards

·         An expression whose value is either True or False

Boolean expression

94
New cards

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

branch

95
New cards

·         A conditional statement with a series of alternative branches.

chain conditional

96
New cards

The boolean expression in a conditional statement that determines which branch runs

condition

97
New cards

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

conditional statement

98
New cards

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

logical operator

99
New cards

·         An operator, %, that works on integers and returns the remainder when one number is divided by another

modulus operator

100
New cards

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

relational operator