Tuples

What is a tuple?

A tuple is an ordered collection that can't be modified. They are useful when you have a collection of items that shouldn't change throughout the life of your program.

How do you define a tuple?

Tuples are usually defined by parentheses.

How do you work with a tuple?

Elements in a tuple are accessed using indexes. You can use a for loop to loop through a tuple. If you try to modify an element in a tuple, you'll receive an error.