1.

What Is The Difference Between A Tuple And A List?

Answer»

A tuple is a list that is immutable. A list is mutable i.e. The members can be CHANGED and ALTERED but a tuple is immutable i.e. the members cannot be changed.
Other SIGNIFICANT difference is of the syntax. A list is defined as
list1 = [1,2,5,8,5,3,]
LIST2 = ["Sachin", "Ramesh", "Tendulkar"]
A tuple is defined in the FOLLOWING way
tup1 = (1,4,2,4,6,7,8)
tup2 = ("Sachin","Ramesh", "Tendulkar")

A tuple is a list that is immutable. A list is mutable i.e. The members can be changed and altered but a tuple is immutable i.e. the members cannot be changed.
Other significant difference is of the syntax. A list is defined as
list1 = [1,2,5,8,5,3,]
list2 = ["Sachin", "Ramesh", "Tendulkar"]
A tuple is defined in the following way
tup1 = (1,4,2,4,6,7,8)
tup2 = ("Sachin","Ramesh", "Tendulkar")



Discussion

No Comment Found