a) Define the Tuple Data Type in Python
A tuple is a built-in data type in Python used to store multiple items in a single variable. Tuples are ordered and immutable, meaning the elements cannot be changed after creation.
Syntax Example:

b) Differences Between a Tuple and a List
Feature | Tuple | List |
---|---|---|
Mutability | Immutable (cannot be changed) | Mutable (can be modified) |
Syntax | Defined using () | Defined using [] |
Performance | Faster than lists | Slower than tuples |
Use Case | Suitable for fixed data | Suitable for dynamic data |
Methods | Fewer built-in methods | More built-in methods |