Differentiate list and tuple with an example?



Differentiate list and tuple with an example?..

Answer / Kanhai Kumar Jha

Lists in Python are mutable, meaning their elements can be added, deleted, or modified. Tuples, on the other hand, are immutable; their elements cannot be changed once assigned. An example: lists_example = [1, 2, 3]; tuples_example = (1, 2, 3)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How do I use xrange in python 3?

1 Answers  


Explain me what is a built-in function that python uses to iterate over a number sequence?

1 Answers  


What are built in types in python?

1 Answers  


Print the length of each line in the file ‘file.txt’ not including any whitespaces at the end of the lines?

1 Answers  


Is python shell scripting?

1 Answers  


What is the usage of help() function in python?

1 Answers  


What are static methods for?

1 Answers  


Explain how to create a multidimensional list.

1 Answers  


Write a sample program in enumerate()function in python?

1 Answers  


How do you write a range in python?

1 Answers  


Explain the use of with statement?

1 Answers  


What is the difference between range and arange in python?

1 Answers  


Categories