A tuple
A tuple in Python is an ordered and immutable collection of elements. Unlike lists, tuples cannot be modified after creation, making them useful for storing fixed data.
Key Characteristics of Tuples
Feature Description
Ordered Elements maintain their defined order.
Immutable Cannot be changed (no addition, removal, or modification).
Heterogeneous Can contain different data types (int, string, float, etc.).
Indexed Elements can be accessed using index numbers.
Faster More efficient than lists in performance.
Comments
Post a Comment