, asked
Views : 1

What's the difference between lists and tuples in Python?

What's the difference between lists and tuples in Python?                      

1 Answer
Malhar Lathkar

List and Tuple are called as sequence data types of Python. Objects of both types are comma separated collection of items not necessarily of same type. However, main difference between list and tuple is that list object is mutable whereas tuple object is immutable. Immutable object can not be modified once it is created in memory. Hence it is not possible to add, modify or remove item from tuple object. On the other hand these operations can be performed on a list.

Advertisements
Related Questions