Glossary

absolute value - The positive form of a negative number. For example, the absolute value of -2 is 2. The absolute value of a positive number is simply the positive number itself.

AI - see, artificial intelligence

algorithm - A series of instructions to compute something.

applications - A program that is run by an operating system. See also, program.

arguments - The values that are passed for parameters in a function call.

artificial intelligence - Code or a program that can intelligent make decisions (for example, decisions when playing a game) in response to user actions.

ASCII art - Using text characters and spaces to draw simple pictures.

assembly language - The simplest programming language. Assembly language instructions are a human-readable form that can directly translate into machine code instructions.

assignment operator - The = sign. Used to assign values to variables.

assignment statement - A line of code that assigns a value to a variable using the assignment operator. This defines, that is, creates the variable when used with a new variable. For example: spam = 42

asterisk - The * symbol. The asterisk is used as a multiplication sign.

augmented assignment operator - The +=, -=, *=, and /= operators. The assignment spam += 42 is equivalent to spam = spam + 42.

block - A group of lines of code with the same amount of indentation. Blocks can contain other blocks of greater indentation inside them.

boolean - A data type with only two values, True and False.

boolean operator - Boolean operators include and, or, and not.

break statement - The break statement immediately jumps out of the current while or for loop to the first line after the end of the loop's block.

brute force - In cryptography, to try every possible key in order to decrypt an encrypted message.

caesar cipher - A simple substitution cipher in which each symbol is replaced by one and only one other symbol.

cartesian coordinate system - A system of coordinates used to identify exact points in some area of space (such as the monitor, or on a game board). Cartesian coordinates systems commonly have two coordinates, one of the X-axis (that is, the horizontal left-right axis) and one of the Y-axis (that is, the vertical up-down axis).

case-sensitivity - Declaring different capitalizations of a name to mean different things. Python is a case-sensitive language, so spam, Spam, and SPAM are three different variables.

central processing unit - CPU, the main chip that your computer uses to process software instructions.

cipher - In cryptography, an algorithm used to encrypt and decrypt messages with a certain key.

ciphertext - In cryptography, the encrypted form of a message.

comment - Part of the source code that is ignored by the Python interpreter. Comments are there to remind the programmer about something about the code. Comments begin with a # sign and go on for the rest of the line.

commutative property - The property of addition and multiplication that describes how the order of the numbers being added or multiplied does not matter. For example, 2 + 4 = 6, and 4 + 2 = 6. Also, 3 * 5 = 15, and 5 * 3 = 15.

comparison operators - The operators < ("less than"), <= ("less than or equal to"), > ("greater than"), >= ("greater than or equal to"), == ("equal to"), and != ("not equal too").

condition - Another name for an expression, one that exists in an if or while statement that evaluates to a boolean True or False value.

constant variables - Variables whose values do not change. Constant variables are often used because it is easier to type the name of the variable then the value that they store. As a convention, constant variable names are typed in all uppercase letters.

convention - A way of doing things that is not required, but is usually done to make a task easier.

conversion specifiers - The text inside a string that makes use of string interpolation. The most common conversion specifier is %s, which specifies that the variable it interpolates should be converted to a string.

cpu - see, Central Processing Unit

cryptanalysis - The science of breaking secret codes and ciphers.

cryptography - The science of making secret codes and ciphers.

data types - A category of values. Some types in Python are: strings, integers, floats, boolean, lists, and NoneType.

decrementing - To decrease a numeric value by one.

decrypting - To convert an encrypted message to the readable plaintext version.

def statement - A statement that defines a new function. The def statement begins with the def keyword, followed by the function name and a set of parentheses, with any number of parameter names delimited by commas. At the end is a : colon character. For example, def funcName(param1, param2):

delimit - To separate with. For example, the string 'cats,dogs,mice' is delimited with commas.

dictionary - A container data type that can store other values. Values are accessed by a key. For example, spam['foo'] = 42 assigns the key 'foo' of the spam dictionary the value 42.

else statement - An else statement always follows an if statement, and the code inside the else-block is executed if the if statement's condition was False.

empty list - The list [], which contains no values and has a length of zero. See also, empty string.

empty string - The string '', which contains no characters and has a length of zero. See also, empty list.

encrypting - To convert a message into a form that resembles garbage data, and cannot be understood except by someone who knows the ciphr and key used to encrypt the message.

escape character - Escape characters allow the programmer to specify characters in Python that are difficult or impossible to type into the source code. All escape characters are preceeded by a \ forward backslash character. For example, \n displays a newline character when it is printed.

evaluate - Reducing an expression down to a single value. The expression 2 + 3 + 1 evaluates to the value 6.

execute - The Python interpreter executes lines of code, by evaluating any expressions or performing the task that the code does.

exit - When a program ends. "Terminate" means the same thing.

expression - Values and function calls connected by operators. Expressions can be evaluated down to a single value.

file editor - A program used to type in or change files, including files of Python source code. The IDLE program has a file editor that you use to type in your programs.

floating point numbers - Numbers with fractions or decimal points are not integers. The numbers 3.5 and 42.1 and 5.0 are floating point numbers.

flow chart - A chart that informally shows the flow of execution for a program, and the main events that occur in the program and in what order.

flow control statements - Statements that cause the flow of execution to change, often depending on conditions. For example, a function call sends the execution to the beginning of a function. Also, a loop causes the execution to iterate over a section of code several times.

flow of execution - The order that Python instructions are executed. Usually the Python interpreter will start at the top of a program and go down executing one line at a time. Flow control statements can move the flow of execution to different parts of code in the program.

function - A collection of instructions to be executed when the function is called. Functions also have a return value, which is the value that a function call evaluates to.

function call - A command to pass execution to the code contained inside a function, also passing arguments to the function. Function calls evaluate to the return value of the function.

garbage data - Random data or values that have no meaning.

global scope - The scope of variables outside of all functions. Python code in the global scope cannot see variables inside any function's local scope.

hard-coding - Using a value in a program, instead of using a variable. While a variable could allow the program to change, by hard-coding a value in a program, the value stays permanently fixed unless the source code is changed.

hardware - The parts of a computer that you can touch, such as the keyboard, monitor, case, or mouse. See also, software.

higher-level programming languages - Programming languages that humans can understand, such as Python. An interpreter can translate a higher-level language into machine code, which is the only language computers can understand.

IDLE - Interactive DeveLopment Environment. IDLE is a program that helps you type in your programs and games.

I/O - Input/Output. This is a term used in reference of the data that is sent into a program (input) and that is produced by the program (output).

immutable sequence - A container data type that cannot have values added or deleted from it. In Python, the two immutable sequence data types are strings and tuples.

import statement - A line of code with the import keyword followed by the name of a module. This allows you to call any functions that are contained in the module.

incrementing - To increase the value of a numeric variable by one.

indentation - The indentation of a line of code is the number of spaces before the start of the actual code. Indentation in Python is used to mark when blocks begin and end. Indentation is usually done in multiples of four spaces.

index - An integer between square brackets that is placed at the end of an ordered container variable (most often a list) to evaluate to a specific item in that container. The first index starts at 0, not 1. For example, if spam refers to the list ['a', 'b', 'c', 'd'], then spam[2] evaluates to 'c'.

index error - An index error occurs when you attempt to access an index that does not exist. This is much like using a variable that does not exist. For example, if spam refers to the list ['a', 'b', 'c', 'd'], then spam[10] would cause an index error.

input - The text or data that the user or player enters into a program, mostly from the keyboard.

integer division - Division that ignores any remainder and rounds the evaluated number down. Integer division occurs when both numbers in the division expression are integers. For example, 20 / 7 evaluates to the integer 6, even though the answer is 6.666 or 6 remainder 2.

integers - Integers are whole numbers like 4 and 99 and 0. The numbers 3.5 and 42.1 and 5.0 are not integers.

interactive shell - A part of IDLE that lets you execute Python code one line at a time. It allows you to immediately see what value the expression you type in evaluates to.

interpreter - A program that translates instructions written in a higher-level programming language (such as Python) to machine code that the computer can understand and execute.

iteration - A single run through of the code in a loop's block. For example, if the code in a while-block is executed ten times before execution leaves the loop, we say that there were ten iterations of the while-block's code.

key-value pairs - In dictionary data types, keys are values that are used to access the values in a dictionary, much like a list's index is used to access the values in a list. Unlike lists, dictionary keys can be of any data type, not just integers.

keys - In dictionaries, keys are the indexes used to

keys - In cryptography, a specific value (usuaully a number) that determines how a cipher encrypts a message. To decrypt the message, you must know both the cipher and the key value that was used.

list - The main container data type, lists can contain several other values, including other lists. Values in lists are accessed by an integer index between square brackets. For example, if spam is assigned the list ['a', 'b', 'c'], then spam[2] would evaluate to 'c'.

list concatenation - Combining the contents of one list to the end of another with the + operator. For example, [1, 2, 3] + ['a', 'b', 'c'] evaluates to [1, 2, 3, 'a', 'b', 'c'].

local scope - The scope of variables inside a single functions. Python code inside a function can read the value of variables in the global scope, but any changes or new variables made will only exist while execution is inside that function call.

loop - A block of code inside a loop (after a for or while statement) will repeatedly execute until some condition is met.

loop unrolling - Replacing code inside a loop with multiple copies of that code. For example, instead of for i in range(10): print 'Hello', you could unroll that loop by having ten lines of print 'Hello'

machine code - The language that the computer's CPU understands. Machine code instructions are series of ones and zeros, and is generally unreadable by humans. Interpreters (such as the Python interpreter) translate a higher-level language into machine code.

matrix - Another name for a list that only contains other lists.

methods - Functions that are associated with values of a data type. For example, the string method upper() would be invoked on a string like this: 'Hello'.upper()

module - A separate Python program that can be included in your programs so that you can make use of the functions in the module.

modulus operator - The "remainder" operator that is represented with a % percent sign. For example, while 20 / 7 is 6 with a remainder of 2, 20 % 7 would evaluate to 2.

mutable sequence - A container data type that is ordered and can have values added or removed from it. Lists are a mutable sequence data type in Python.

negative numbers - All numbers less than 0. Negative numbers have a minus sign in front of them to differentiate them from positive numbers, for example, -42 or -10.

nested loops - Loops that exist inside other loops.

None - The only value in the NoneType data type. "None" is often used to represent the lack of a value.

operating system - A large program that runs other software programs (called applications) the same way on different hardware. Windows, Mac OS, and Linux are examples of operating systems.

operators - Operators connect values in expressions. Operators include +, -, *, /, and, and or

ordinal - In ASCII, the number that is represented by an ASCII character. For example, the ASCII character 'A' has the ordinal 65.

origin - In cartesian coordinate systems, the point at the coordinates 0, 0.

OS - see, operating system

output - The text that a program produces for the user. For example, print statements produce output.

overwrite - To replace a value stored in a variable with a new value.

parameter - A variable that is specified to have a value passed in a function call. For example, the statement def spam(eggs, cheese) defines a function with two parameters named eggs and cheese.

pie chart - A circular chart that shows percentage portions as portions of the entire circle.

plaintext - The decrypted, human-readable form of a message.

player - A person who plays the computer game.

positive numbers - All numbers equal to or greater than 0.

pound sign - The # sign. Pound signs are used to begin comments.

print statement - The print keyword followed by a value that is to be displayed on the screen.

program - A collection of instructions that can process input and produce output when run by computer.

programmer - A person who writes computer programs.

reference - Rather than containing the values themselves, list variables actually contain references to lists. For example, spam = [1, 2, 3] assigns spam a reference to the list. cheese = spam would copy the reference to the list spam refers to. Any changes made to the cheese or spam variable would be reflected in the other variable.

return statement - The return followed by a single value, which is what the call to the function the return statement is in will evaluate to.

return value - The value that a call to the function will evaluate to. You can specify what the return value is with the return keyword followed by the value. Functions with no return statement will return the value None.

scope - See, local scope and global scope.

sequence - A sequence data type is an ordered container data type, and have a "first" or "last" item. The sequence data types in Python are lists, tuples, and strings. Dictionaries are not sequences, they are unordered. See also, unordered.

shell - see, interactive shell

simple substitution ciphers -

slice - A subset of values in a list. These are accessed using the : colon character in between the square brackets. For example, if spam has the value ['a', 'b', 'c', 'd', 'e', 'f'], then the slice spam[2:4] has the value ['c', 'd']. Similar to a substring.

software - see, program

source code - The text that you type in to write a program.

statement - A command or line of Python code that does not evaluate to a value.

string concatenation - Combining two strings together with the + operator to form a new string. For example, 'Hello ' + 'World!' evaluates to the string 'Hello World!'

string formatting - Another term for string interpolation.

string interpolation - Using conversion specifiers in a string as place holders for other values. Using string interpolation is a more convenient alternative to string concatenation. For example, 'Hello, %s. Are you going to %s on %s?' % (name, activity, day) evaluates to the string 'Hello, Albert. Are you going to program on Thursday?', if the variables have those corresponding values.

string - A value made up of text. Strings are typed in with a single quote ' or double " on either side. For example, 'Hello'

substring - A subset of a string value. For example, if spam is the string 'Hello', then the substring spam[1:4] is 'ell'. Similar to a list slice.

symbols - In cryptography, the individual characters that are encrypted.

syntax error - An error that occurs when the Python interpreter does not understand the source code.

terminate - When a program ends. "Exit" means the same thing.

tracing - To follow through the lines of code in a program in the order that they would execute.

truth tables - Tables showing every possible combination of

tuple - A container data type similar to a list. Tuples are immutable sequence data types, meaning that they cannot have values added or removed from them. For example, (1, 2, 'cats', 'hello') is a tuple of four values.

type - see, data types

unordered - In container data types, unordered data types do not have a "first" or "last" value contained inside them, they simply contain values. Dictionaries are the only unordered data type in Python. Lists, tuples, and strings are ordered data types. See also, sequence.

user - The person using the program.

value - A specific instance of a data type. 42 is a value of the integer type. 'Hello' is a value of the string type.

variables - A container that can store a value. List variables contain references to lists.

while loop statement - The while keyword, followed by a condition, ending with a : colon character. The while statement marks the beginning of a while loop.

x-axis - In cartesian coordinate systems, the horizontal (left-right) coordinate axis.

y-axis - In cartesian coordinate systems, the vertical (up-down) coordinate axis.