1.

What is the difference between a tuple and a list?

Answer»

A tuple is immutable whereas a list is mutable. 

A tuple cannot be changed whereas a list can be changed internally. 

A tuple uses parentheses (()) whereas a list uses square brackets ([]). 

tuple initialization: a = (2, 4, 5) 

list initialization: a = [2, 4, 5]



Discussion

No Comment Found