1/196
chapter 1-18
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is a rectangular block (typically with top and bottom notches) that performs some task?
function
What is the image associated with an object?
costume
In Scratch, what is an object that can appear on the stage?
sprite
In Scratch, what is a stack of blocks?
script
What is the category for the ask (__) and wait block?
sensing
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
What block is used to concatenate two values and get a single string?
join
Which of the following (one or more) may appear at the beginning of a script
Looks/Events/Sound/Motion
hich of the following (one or more) may appear anywhere in a script?
Motion/Looks/Sound
What is the category for the if-then and if-then-else blocks?
control
A function that is run in response to an event is an event _____.
handler
An value that is either true/yes or false/no is what type (one word)?
boolean
What is the category for the say (___) block?
looks
What is the name of the block that converts a decimal number to an integer?
round
What is the category for the forever, repeat, and repeat-until blocks?
control
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
A _____ variable is visible to all sprites.
global
In Scratch, a sprite can make an announcement or send a message. What is the name of the block that does this?
broadcast
In software, a function will always be deterministic.
false
In computer programming, a function always returns a value.
false
A _____ variable is visible to only one sprite.
local
In software, a function can have side effects (that is, change the state of the world).
ture
In mathematics, a function always returns a value.
ture
What is the name given to a container for (or reference to) a value that can be used later in a program?
variable
An operator, such as '+' is simply syntactic sugar for a function.
true
In mathematics, a function can have side effects (that is, change the state of the world).
false
In mathematics, a function will always be deterministic.
true
An if-then block allows a script to ______ code if a boolean expression evaluates to false.
skip
Write an expression that converts the value 6 to a(n) str.
str(6)
a category of values such as int float or str
type
a named sequence of statements that can be called to perform some useful operation
function
a type that represents numbers with fractional parts
floating point
an operator // that divides two numbers and rounds down to an integer
integer division
a combination of variables values and operators
expression
A symbol, like + and *, that denotes an arithmetic operation like addition or multiplication.
arithmetic operator
A type that represents sequences of characters.
string
Any of the languages that people speak that evolved naturally.
natural language
Any of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer programs.
formal language
An error in a program that makes it impossible to parse—and therefore impossible to run.
syntax error
Joining two strings end-to-end.
concatenation
The process of finding and correcting errors
debugging
An integer, floating-point number, or string—or one of other kinds of values we will see later.
value
A defect in a program.
bug
A type that represents whole numbers and their negative counterparts.
integer
An expression—or part of an expression—that executes a function
function call
One of the values on which an operator operates
operand
What type of error is the following?
|
semantic error
What type of error is the following?
|
runtime error
What type of error is the following?
|
syntax error
A value provided to a function when the function is called.
argument
A statement that assigns a value to a variable.
assignment
A reserved word used to specify a part of the command structure of a program.
keyword
A(n) _______ error causes a program to display an error message and exit.
runtime
A graphical representation of a set of variables and the values they refer to.
state diagram
Perform the operations in an expression in order to compute a value.
evaluate
A(n) _______ error causes a program to do the wrong thing, but not to display an error message.
semantic
Run a statement and do what it says.
execute
A name that refers to a value
variable
The operator used to access a function or variable in another module
dot operator
Text included in a program that provides information about the program but has no effect on its execution.
comment
A file that contains Python code, including function definitions and sometimes other statements
module
One or more lines of code that represent a command or action.
statement
Another word for a runtime error.
exception
A statement that reads a module file so we can use the variables and functions it contains.
import
Which of the following are valid variable names?
myAge/average/student
A function ___________ or signature is the first line of code of the function.
header
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.
In Python, __________ help to perform problem decomposition and abstraction in our programs.
functions
Functions reduce _____________, making it easier to test and fix our code since a change needs to be made in only one place.
duplication
Problem decomposition involves breaking a large problem into __________ tasks.
smaller
The ____ keyword is used to tell Python that what follows is a function definition.
def
A statement that runs one or more statements, often repeatedly.
loop
An argument that includes the name of the parameter
keyword argument
A statement that creates a function.
function definition
The process of transforming a sequence of statements into a function definition
encapsulation
A string enclosed in triple quotes that can span more than one line of a program.
multiline string
A window used to display graphical elements including lines, circles, rectangles, and other shapes.
canvas
A process for writing programs
development plan
A name used inside a function to refer to the value passed as an argument
parameter
The first line of a function definition.
header
A requirement that should be satisfied by the caller before a function starts
precondition
A process for designing the interface of a function, which includes the parameters it should take.
interface design
The process of replacing something unnecessarily specific (like a number) with something appropriately general (like a variable or parameter).
generalization
A string that appears at the top of a function definition to document the function's interface.
docstring
The sequence of statements inside a function definition.
body
A variable defined inside a function, and which can only be accessed inside the function
local variable
The process of modifying a working program to improve function interfaces and other qualities of the code.
refactoring
A requirement that should be satisfied by the function before it ends
postcondition
A value created by a function definition
function object
We get a function to do its work by calling it with values (also called ___________) that are assigned to its parameters.
arguments
· One or more statements indented to indicate they are part of another statement.
Block
· An expression whose value is either True or False
Boolean expression
· One of the alternative sequences of statements in a conditional statement.
branch
· A conditional statement with a series of alternative branches.
chain conditional
The boolean expression in a conditional statement that determines which branch runs
condition
A statement that controls the flow of execution depending on some condition.
conditional statement
· One of the operators that combines boolean expressions, including and, or, and not.
logical operator
· An operator, %, that works on integers and returns the remainder when one number is divided by another
modulus operator
· One of the operators that compares its operands: ==, !=, >, <, >=, and <=.
relational operator