In [7]:
# tuples are immutable sequences notated as ()
a = (1, 2, 3)
len(a)


Out[7]:
3

In [8]:
('fish', 3)


Out[8]:
('fish', 3)

In [9]:
# a tuple can contain any kind of object, including other tuples
t = (4, ('fish',7), True)
t[1]


Out[9]:
('fish', 7)

In [10]:
# tuples support indexing (and slicing, which we will see later)

In [11]:
# tuples support "in"
t = ('a', 'b', 'c')
'a' in t


Out[11]:
True

In [12]:
-77 in t


Out[12]:
False

In [13]:
# tuples are used for multiple assignment
a = 'me'
b = 'you'
c = 'them'

(a, b, c) = ('me', 'you', 'them')

In [14]:
# or just
a, b, c = ('me', 'you', 'them')
c


Out[14]:
'them'