You are asked some Python fundamentals.
-
What is a
tuple
in Python? Describe its key properties (e.g., ordering, mutability, hashability).
-
How does a tuple differ from a list in terms of:
-
syntax,
-
mutability and available operations,
-
typical use cases,
-
performance or memory characteristics?
-
Give a few concrete examples of when you would prefer to use a tuple rather than a list (for example, in function returns, as dictionary keys, or to represent fixed-size records).