10. Quiz: Tuples

Tuples

QUIZ QUESTION::

Match the following qualities to their data structure.

ANSWER CHOICES:



Data Structure

Quality

immutable

ordered

immutable

ordered

unordered

mutable

SOLUTION:

Data Structure

Quality

immutable

ordered

ordered

immutable

ordered

ordered

mutable

Tuples

What would the output of the following code be? (Treat the comma in the multiple choice answers as newlines.)

tuple_a = 1, 2
tuple_b = (1, 2)

print(tuple_a == tuple_b)
print(tuple_a[1])
SOLUTION: True, 2

Tuples Playground

Start Quiz:

## You may test any code out here. Use Test Run to see your output