Tuple vs List

Pratikbais
1 min readDec 15, 2021

In a different article of the same series, we have discussed tuple versus list. Both the terms have the same purpose of storing the data with a different nature. Then the question that arises here is what is the difference between list and tuple in python? And why it is necessary to know the difference between list and tuple in python? Lists are used to store dynamic values where Tuples can store static values. In real life, we need to store the data in two ways. In the first way, we store the data in a data structure and later access the data and perform operations on the data. For example, the name of the students. We can store the names in a list and can access the names, insert new names, delete particular names. In a second way, we store the data in a data structure and can access the data only without modifying the data. For example, the name of topper students for a particular year. We can store the topper names in a tuple because once declare, the names will not alter, we can only access the names. So, this is the basic difference between list and tuple in python. In this article, we will take a deeper look at the difference between Lists and Tuples in Python with an example.

--

--