AP Computer Science Principles Chapter 2 and 4 Vocab

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

assignment token

(=)should not be confused with the mathematical comparison operator using the same symbol.

object

A "thing" to which a variable can refer. This could be a screen window, or one of the turtles you have created.

str

A Python data type that holds a string of characters.

int

A Python data type that holds positive and negative whole numbers.

float

A Python data type which stores floating-point numbers. When printed in the standard format, they look like decimal numbers. Beware of rounding errors when you use floats, and remember that they are only approximate values.

iteration

A basic building block for algorithms (programs). It allows steps to be repeated. Sometimes called looping.

range

A built-in function in Python for generating sequences of integers. It is especially useful when we need to write a for loop that executes a fixed number of times.

expression

A combination of operators and operands (variables and values) that represents a single result value. Expressions are evaluated to give that result.

terminating condition

A condition that occurs which causes a loop to stop repeating its body.

turtle

A data object used to create pictures.

module

A file containing Python definitions and statements intended for use in other Python programs.

type conversion function

A function that can convert a data value from one type to another.

method

A function that is attached to an object. Invoking or activating the method causes the object to respond in some way, e.g. forward is the method when we say tess.forward(100).

state snapshot

A graphical representation of a set of variables and the values to which they refer, taken at a particular instant during the program's execution.

class

An extensible program-code-template for creating objects, providing initial values for state

statement

An instruction that the Python interpreter can execute.

invoke

An object has methods. We use the verb invoke to mean activate the method. Invoking a method is done by putting parentheses after the method name, with some possible arguments. So wn.exitonclick() is an invocation of the exitonclick method.

instance

An object that belongs to a class. tess and alex are different instances of the class Turtle

integer division

An operation that divides one integer by another and yields an integer. Integer division yields only the whole number of times that the numerator is divisible by the denominator and discards any remainder.

loop body

Any number of statements nested inside a loop. The nesting is indicated by the fact that the statements are indented under the for loop statement.

increment

Both as a noun and as a verb, increment means to increase by 1.

decrement

Decrease by 1.

modulus operator

Gives the remainder after performing integer division.

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.

operand

One of the values on which an operator operates.

attribute

Some state or value that belongs to a particular object. For example, tess has a color.

state

The collection of attribute values that a specific data object maintains.

sequential

The default behavior of a program. Step by step processing of algorithm.

control flow

The order in which individual statements, instructions or function calls of an imperative program are executed or evaluated.

rules of precedence

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

initialization (of a variable)

To initialize a variable is to give it an initial value. Since in Python variables don't exist until they are assigned values, they are initialized when they are created. In other programming languages this is not the case, and variables can be created without being initialized, in which case they have either default or garbage values.

evaluate

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

prompt string

Used during interactive input to provide the use with hints as to what type of value to enter.

variable name

A name given to a variable.

variable

A name that refers to a value.

value

A number or string (or other things to be named later) that can be stored in a variable or computed in an expression.

reference diagram

A picture showing a variable with an arrow pointing to the value (object) that the variable refers to. See also state snapshot.

keyword

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

data type

A set of values. The type of a value determines how it can be used in expressions. So far, the types you have seen are integers (int), floating-point numbers (float), and strings (str).

operator

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

for loop

A statement in Python for convenient repetition of statements in the body of the loop.

assignment statement

A statement that assigns a value to a name (variable). To the left of the assignment operator, =, is a name. To the right of the assignment token is an expression which is evaluated by the Python interpreter and then assigned to the name.

canvas

A surface within a window where drawing takes place.

loop variable

A variable used as part of a for loop. It is assigned a different value on each iteration of the loop, and is used as part of the terminating condition of the loop, when it can no longer get a further value.

object

Also known as a data object (or data value). The fundamental things that programs are designed to manipulate (or that programmers ask to do things for them).


संबंधित स्टडी सेट्स

U.S. History Chapter 16 Study Guide

View Set

MGT 301, Chapter 4, Internal Analysis

View Set

Twentieth-Century Art-Fauvism/Cubism/German Expressionism/Purism/Futurism

View Set

NUR 302 (Module 1 Sherpath Lessons)

View Set

Strategic Management - Chapter 3

View Set

Health and Illness: exam 3 practice questions

View Set

A1.1. Grammar Course. Class 9: Some / a / an / any / no

View Set