Python does not have built-in array types, but it does have a built-in list type. Python lists (list
s)
are written as comma-separated values in square brackets. For example, ['alpha', 'bravo', 'charlie']
is a list containing three strings.
Python also has tuples (tuple
s), which are like lists except that they are immutable; they
cannot be changed once they are created. (Python's strings are also immutable.) Tuples are usually written like
lists with parentheses in place of the square brackets, except in two cases. First, if a tuple has exactly one
element, a comma must be written after that element to distinguish the tuple for a parenthesized expression, e.g.,
('alpha',)
. Empty tuples, however, are written ()
. Second, in certain circumstances
where there is no ambiguity (such as in a return
statement), the parentheses can be omitted, and
convention is to elide them when possible.
Fill in the placeholders so that the actual outputs match the expected outputs.