7.13. GlossaryΒΆ

accumulator patternΒΆ

A pattern where the program initializes an accumulator variable and then changes it during each iteration, accumulating a final result.

Control FlowΒΆ

Also known as the flow of execution, the order in which a program executes. By default, the control flow is *sequential*.

for loop traversal (for)ΒΆ

Traversing a string or a list means accessing each character in the string or item in the list, one at a time. For example, the following for loop:

for ix in 'Example':
    ...

executes the body of the loop 7 times with different values of ix each time.

indexΒΆ

A variable or value used to select a member of an ordered collection, such as a character from a string, or an element from a list.

loop bodyΒΆ

The loop body contains the statements of the program that will be iterate through upon each loop. The loop body is always indented.

patternΒΆ

A sequence of statements, or a style of coding something that has general applicability in a number of different situations. Part of becoming a mature programmer is to learn and establish the patterns and algorithms that form your toolkit.

rangeΒΆ

A function that produces a list of numbers. For example, range(5), produces a list of five numbers, starting with 0, [0, 1, 2, 3, 4].

sequential flowΒΆ

The execution of a program from top to bottom, one statement at a time

terminating conditionΒΆ

A condition which stops an interation from continuing

traverseΒΆ

To iterate through the elements of a collection, performing a similar operation on each.

You have attempted 1 of 1 activities on this page