Chap. 10 (Tuples) Flashcards
(10 cards)
Define Comparable
A type where one value can be checked to see if it is greater than, less than, or equal to another value of the same type. Types that are comparable can be put in a list and sorted.
Define Data Structure
A collection of related values, often lists, dictionaries, or tuples.
Define DSU
The abbreviation of “decorate-sort-decorate” is a pattern that involves building a list of tuples, sorting, and extracting part of the result.
Define Gather
The operation of assembling a variable-length argument tuple.
Define Hashable
A type that has a hash function. Immutable types, like integers, floats, and strings, are hashable; mutable types like lists or dictionaries are not.
Define Scatter
The operation of treating a sequence as a list of arguments.
Define Shape
(of a data structure) , A summary of the size, type, and composition of a data structure.
Define Singleton
A list (or other sequence) with a single element.
Define Tuple
An immutable sequence of elements.
Define Tuple Assignment
An assignment with a sequence on the right side and a tuple of variables on the left. The right side is evaluated, and then its elements are assigned to the variables on the left.