Skip to content
Related Articles

Related Articles

Python | Difference Between List and Tuple
  • Difficulty Level : Basic
  • Last Updated : 17 Mar, 2021

List and Tuple in Python are the class of data structure. The list is dynamic, whereas the tuple has static characteristics. 
List is just like the arrays, declared in other languages. Lists need not be homogeneous always which makes it the most powerful tool in Python. In Python, the list is a type of container in Data Structures, which is used to store multiple data at the same time. Lists are a useful tool for preserving a sequence of data and further iterating over it. 
Syntax: 

list_data = ['an', 'example', 'of', 'a', 'list']

Tuple is also a sequence data type that can contain elements of different data types, but these are immutable in nature. In other words, a tuple is a collection of Python objects separated by commas. The tuple is faster than the list because of static in nature. 
Syntax:  

tuple_data = ('this', 'is', 'an', 'example', 'of', 'tuple')

Difference Between List and Tuple in Python:  

SR.NO.LISTTUPLE
1Lists are mutableTuples are immutable
2Implication of iterations is Time-consumingThe implication of iterations is comparatively Faster
3The list is better for performing operations, such as insertion and deletion.Tuple data type is appropriate for accessing the elements
4Lists consume more memoryTuple consume less memory as compared to the list
5Lists have several built-in methodsTuple does not have many built-in methods.
6The unexpected changes and errors are more likely to occurIn tuple, it is hard to take place.

 

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :