How are Tuples different from Lists when both are sequences?
Answers
Answered by
12
We can conclude that although both lists and tuples are data structures in Python, there are remarkable differences between the two, with the main difference being that lists are mutable while tuples are immutable. A list has a variable size while a tuple has a fixed size.
Answered by
1
Tuples and Lists are the part of Python language but they are different to each other in many ways.
Some main points of difference between two are:
- Lists are used to store variables having different values but with same data type whereas Tuples are used to store variables having different values with different data type.
- Lists are active in nature but tuples are steady in nature.
- The iteration process in lists are slow whereas in tuples it is quite faster in comparison.
- Lists are more prone to errors as compared to tuples.
- Lists also consume more storage space in comparison to tuples.
Similar questions
Hindi,
2 months ago
Social Sciences,
2 months ago
India Languages,
2 months ago
Social Sciences,
4 months ago
Science,
4 months ago
English,
10 months ago
Math,
10 months ago