Introduction

TUPLES

• Tuple: an immutable sequence
    • Very similar to a list
    • Once it is created it cannot be changed
    • Format: tuple_name = (item1, item2)
    • Tuples support operations as lists
        • Subscript indexing for retrieving elements
        • Methods such as index
        • Built in functions such as len, min, max
        • Slicing expressions
        • The in, +, and * operators
• Tuples do not support the methods:
    • append
    • remove
    • insert
    • reverse
    • sort
• Advantages for using tuples over lists:
    • Processing tuples is faster than processing lists
    • Tuples are safe
    • Some operations in Python require use of tuples
• list() function: converts tuple to list
• tuple() function: converts list to tuple