Chapter 2: Variables, Expressions, and Statements Flashcards
A statement that assigns a value to a variable.
assignment
To join two operands end to end (eg. strings)
‘Test’ + ‘Test2’ = TestTest2
concatenate
(+)
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.
comment
To simplify an expression by performing the operations in order to yield a single value.
evaluate
A combination of variables, operators, and values that represents a single result value.
expression
A type that represents numbers with fractional parts.
floating point
A type that represents whole numbers.
integer
A reserved word that is used by the compiler to parse a program; cannot be used as variable names.
keyword
A memory aid. Often utilized for naming variables.
mnemonic
An operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another.
modulus operator
One of the values on which an operator operates.
operand
A special symbol that represents a simple computation like addition, multiplication, or string concatenation.
operator
The set of rules governing the order in which expressions involving multiple operators and operands are evaluated.
(PEMDAS)
rules of precedence
A section of code that represents a command or action. (eg assignment and print)
statement
A type that represents sequences of characters.
string
A category of values. The ones we have seen so far are integers (int), floating-point numbers (float), and strings (str).
type
One of the basic units of data, like a number or string, that a program manipulates.
value
A name that refers to a value.
Can only be numbers and letters
No spaces
Can’t start with a number
variable
rounds result down to nearest integer
eg. 59 // 60 = 0
eg. 59.0 // 60 = 0.0
floored (integer) division operator
( // )
newline
special character that causes a line break
\n
any value (string, integer, float, etc.) that is literally what it says it is
literal value
expression composed of more than one data type
eg. 42.0/5 (float/integer)
mixed expression
tab
\t
carriage return
(returns cursor back to beginning of line)
\r
double quote
\”
backslash
\\