Skip to content

Latest commit

 

History

History
113 lines (96 loc) · 2.41 KB

vocab.md

File metadata and controls

113 lines (96 loc) · 2.41 KB

Vocabulary

Terms you will need to know when learning Python

Expression

A collection of variables, values, and function calls that can be Evaluated to a single value.

examples

1 + 5
"hello" + ", world!"
len("cheese") + x

Evaluation

The process of reducing an expression of values and functions to a single value.

example:

(3 + 48) / 6
3 + 8
11

Execution

Similar to evaluation. Running a program, one statement after another.

Statement

A single instruction given to the computer, for example, an assignment statement, or an if statement.

Variable

A named container (or "box") that can hold a value.

examples:

x
y
name
last_name

Value

An individual piece of data - either a literal, a variable, or a function result.

examples:

3
"hello"
len("hello")
first_name

Literal

The actual number 1 or string "hello" - as compared to a variable or expression that evaluates to a value.

examples:

"hello"
1
-45.29

Type, or Data Type

A category of values, often arranged in a hierarchy (think animal classification). Numbers, Interger Numbers, Characters, Strings (collection of characters)

examples:

int
str

function

A list of statements and expressions for transforming a set of input values to an output value

examples of calling functions:

sum(1, 2, 3)     # -> 6
str(x)           # -> string representation of x
len("hello")     # -> 5

Operator

A function that "operates" on one or more values.

examples of using operators:

"hello" + ", world"
10 / 4
11 // 3
9 - 1
4 * -1

Resolve

The process of looking up a value named by a variable.

Assignment

The process of putting a value into a named variable ("box"). Confusingly written "=", as in x = x + 1.

examples:

x = x + 1
y = m * x + b
salutation = "Ms. " + first_name + " " + last_name
count = 23

Comment

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

example:

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