Glossary
This page describes a number of common terms in Python and programming in general
A
B
- boolean - A type that represents a truth value - either True or False. This can be thought of as the answer to a yes/no question is x > 3? Either it is or it isn't.
C
- character - A type that represents single letter, such as 'a' or 't'. A sequence of characters is a string. Note that numbers can also be represented as characters; there is a difference in Python between the character '1' and the integer 1: they have different types.
D
E
- expression - A combination of operators and operands that yields a value with a particular type. For example, 3 + x is an integer expression and x == 3 is a boolean expression. An expression can also be as simple as just a variable or a literal, so "x" is an expression (the type will depend on the type of "x"), as is "hello" (a string expression). An expression can also include function calls, like square(x) * pi.
F
- function - A block of code (sometimes called a "subroutine") that can be called over and over again from elsewhere in the program. May take arguments to dictate its behaviour and may return a value. For example, in the following code the function "square" takes a single argument ("x") and returns ("x*x"). For much more information, see here.
def square(x):
return x*x
G-H
(no entries yet)
I
J-K
(no entries yet)
L
- list - A sequence of items stored together in a sequential list. Much more information here.
- literal - A raw value used in a program. For example, in the code:
greeting = "hello"
"hello" is a string literal.
in the code:
x = 3
3 is an integer literal.
M-N
(no entries yet)
O
- operand - An argument passed to an operator. For example, in "3 * x" both 3 and x are operands to the operator "*"
- operator - A symbol that indicates some operation on one or more operands. For example, in "[1,2,3] + [4,5]", both "[1,2,3]" and "[4,5]" are operands to the operator "+".
S
- sequence - A group of [#type]s that consist of sequences of other types. Some examples of sequence types include strings, (a sequence of characters) and lists (a sequence that can consist of a variety of types).
- string - A sequence type that contains a list of [#character]s. For example "hello" is a string consisting of the characters "h", "e", "l", "l" and "o".
T
page revision: 10, last edited: 16 Oct 2007 11:01