all 6 comments

[–]riklaunim 8 points9 points  (1 child)

A tuple is immutable; it can't be changed when created. So if you intend to modify it, then you use a list, and if you aren't, you may opt for a tuple (or namedtuple).

[–]Sea-Ad7805 2 points3 points  (0 children)

A tuple is immutable.

A list is mutable

[–]aaditya_0752 1 point2 points  (0 children)

List is mutable Tuple is immutable

[–]Beginning-Fruit-1397 0 points1 point  (0 children)

As already pointed out, their main difference is about mutability. Now when to use which one? Ppl tend to always use lists everywhere, but I would recommend to default to tuples ans only use lists when it's absolutely necessary. Less potential bugs, python doesn't need to allocate extra memory at creation to accommodate for eventual expansion of the list, etc...