Chapter 2: Variables, Expressions, and Statements Flashcards

1
Q

A statement that assigns a value to a variable.

A

assignment

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

To join two operands end to end (eg. strings)
‘Test’ + ‘Test2’ = TestTest2

A

concatenate
(+)

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

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.

A

comment

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

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

A

evaluate

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

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

A

expression

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

A type that represents numbers with fractional parts.

A

floating point

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

A type that represents whole numbers.

A

integer

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

A reserved word that is used by the compiler to parse a program; cannot be used as variable names.

A

keyword

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

A memory aid. Often utilized for naming variables.

A

mnemonic

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

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

A

modulus operator

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

One of the values on which an operator operates.

A

operand

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

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

A

operator

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

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

A

rules of precedence

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

A section of code that represents a command or action. (eg assignment and print)

A

statement

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

A type that represents sequences of characters.

A

string

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

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

A

type

17
Q

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

A

value

18
Q

A name that refers to a value.
Can only be numbers and letters
No spaces
Can’t start with a number

A

variable

19
Q

rounds result down to nearest integer
eg. 59 // 60 = 0
eg. 59.0 // 60 = 0.0

A

floored (integer) division operator
( // )

20
Q

newline
special character that causes a line break

A

\n

21
Q

any value (string, integer, float, etc.) that is literally what it says it is

A

literal value

22
Q

expression composed of more than one data type
eg. 42.0/5 (float/integer)

A

mixed expression

23
Q

tab

A

\t

24
Q

carriage return
(returns cursor back to beginning of line)

A

\r

25
Q

double quote

A

\”

26
Q

backslash

A

\\