What is difference between tuple and list?



What is difference between tuple and list?..

Answer / Rakesh Singh

The main difference between tuples and lists in Python is that tuples are immutable (unchangeable), while lists are mutable (changeable). Tuples can contain items of different data types, just like lists. They can be used when the order of elements needs to be preserved but there's no need for modification. Lists, on the other hand, are more flexible and can be modified at any time.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is python rest api?

1 Answers  


How are instance variables different from class variables?

1 Answers  


What are the 3 types of relation?

1 Answers  


How do I find the current module name?

1 Answers  


What is none literal in python?

1 Answers  


What is pack in python?

1 Answers  


What do you understand by deque in python?

1 Answers  


Is there a way to remove the last object from a list?

0 Answers  


Can python be used for web client and web server side programming?

1 Answers  


Does python have a string ‘contains’ substring method?

1 Answers  


What is a lambda in programming?

1 Answers  


What does __ name __ mean in python?

1 Answers  


Categories