Ch 2 Simple Python Data Flashcards

1
Q

assignment token

A

= is Python’s assignment token, which should not be confused with the mathematical comparison operator using the same symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

comment

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

data type

A

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 number (float), and strings (str)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

decrement

A

decrease by 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

evaluate

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

expression

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

float

A

A Python data type which store floating-point numbers. Floating-point numbers are stored internally in two parts: a base and an exponent. When printed in the standard format, they look like decimal numbers. Beware of rounding errors when you sue floats and remember that they are only approximate values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

increment

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

initialization (of a variable)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

int

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

integer division

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

keyword

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

modus operator

A

Also called remainder operator or integer operator. Gives the remainder after performing integer division

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

object

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

operand

A

One of the values on which an operator operates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

operator

A

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

17
Q

prompt string

A

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

18
Q

reference diagram

A

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

19
Q

rules of precedence

A

the set of rules governing the order in which expressions involving multiple operators and operands are evaluated. PEMDAS. 1 parentheses, 2 exponentiation, 3 multiplication and division, 4 additions and subtraction. Those operators that share a level (like multiplication and division) execute from left to right. So 6 * 9 / 7 would execute as (6 * 9) / 7. Exponentiation is read from right to left. So 4 ** 2 ** 3 would be 2 ** 3 and then 4 ** 8.

20
Q

state snapshot

A

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.

21
Q

statement

A

An instruction that the Python interpreter can execute. So far we have only seen the assignment statement, but we will soon meet the import statement and the for statement, i.e., a statement is anything and everything that makes up one line of Python code

22
Q

str

A

A Python data type that holds a string of characters.

23
Q

type conversion function

A

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

24
Q

value

A

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

25
Q

variable

A

A name that refers to a value

26
Q

variable name

A

A name given to a variable.