Terms you will need to know when learning Python
A collection of variables, values, and function calls that can be Evaluated to a single value.
1 + 5
"hello" + ", world!"
len("cheese") + x
The process of reducing an expression of values and functions to a single value.
(3 + 48) / 6
3 + 8
11
Similar to evaluation. Running a program, one statement after another.
A single instruction given to the computer, for example, an assignment statement, or an if statement.
A named container (or "box") that can hold a value.
x
y
name
last_name
An individual piece of data - either a literal, a variable, or a function result.
3
"hello"
len("hello")
first_name
The actual number 1 or string "hello" - as compared to a variable or expression that evaluates to a value.
"hello"
1
-45.29
A category of values, often arranged in a hierarchy (think animal classification). Numbers, Interger Numbers, Characters, Strings (collection of characters)
int
str
A list of statements and expressions for transforming a set of input values to an output value
sum(1, 2, 3) # -> 6
str(x) # -> string representation of x
len("hello") # -> 5
A function that "operates" on one or more values.
"hello" + ", world"
10 / 4
11 // 3
9 - 1
4 * -1
The process of looking up a value named by a variable.
The process of putting a value into a named variable ("box"). Confusingly written "=", as in x = x + 1
.
x = x + 1
y = m * x + b
salutation = "Ms. " + first_name + " " + last_name
count = 23
Non-functioning text in your program, after the '#'. Comments can be brief, after some code on the same line, or long (if needed), on lines by themselves. The syntax is the same: just start with a #.
x = x + 10.0 # move 10 pixels to the right
#
# tax_rate -- decimal value to be applied to all in-country sales.
# -- DO NOT CHANGE without accounting approval
#
tax_rate = 0.0925