Back Navigation Next Navigation Conceptual Review (page 34 of 55)

Tuples are similar to lists. They let us store multiple items of the same or different data types in a single object.

The primary difference between lists and tuples is that tuples are immutable (non-changeable). We cannot modify single items in a tuple like we can with list. As a result, looping tends to be faster with tuples relative to lists because python does not need to allocate the overhead necessary to allow for potential changes.

If you have data that do not change, storing those data as tuple will guarantee that it remains write-protected.

Tuples are created using parentheses during assignment ().

Tuples