Python Programming/Tuples and Sets: Difference between revisions

From Wikiversity
Jump to navigation Jump to search
Content deleted Content added
Creating
(No difference)

Revision as of 21:03, 11 August 2016

This lesson introduces Python tuples.

Objectives and Skills

Objectives and skills for this lesson include:[1]

  • Data Structures
    • Tuple
    • Sequences
    • Set

Readings

  1. PythonLearn:

Multimedia

  1. YouTube: Python for Informatics - Chapter 10 - Tuples

Examples

Activities

  1. Complete one or more of the following tutorials:

Key Terms

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 which are comparable can be put in a list and sorted.[2]
data structure
A collection of related values, often organized in lists, dictionaries, tuples, etc.[3]
DSU
Abbreviation of “decorate-sort-undecorate”, a pattern that involves building a list of tuples, sorting, and extracting part of the result.[4]
gather
The operation of assembling a variable-length argument tuple.[5]
hashable
A type that has a hash function. Immutable types like integers, floats, and strings are hashable; mutable types like lists and dictionaries are not.[6]
scatter
The operation of treating a sequence as a list of arguments.[7]
shape (of a data structure)
A summary of the type, size, and composition of a data structure.[8]
singleton
A list (or other sequence) with a single element.[9]
tuple
An immutable sequence of elements.[10]
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.[11]

See Also

References