Tuples have several key characteristics:
-
Immutable: Once a tuple is created, its elements cannot be changed, added, or removed.
-
Ordered: The elements in a tuple maintain their order, meaning that the position of each element is fixed.
-
Heterogeneous: Tuples can contain elements of different data types, such as integers, strings, and other objects.
-
Indexable: You can access elements in a tuple using their index, starting from 0.
-
Hashable: Since tuples are immutable, they can be used as keys in dictionaries, unlike lists.
-
Can contain duplicates: Tuples can have repeated elements, allowing for multiple occurrences of the same value.
These characteristics make tuples useful for storing collections of related data that should not change throughout the program.
