What is difference between list and set in python?



What is difference between list and set in python?..

Answer / Pankaj Chaudhary

In Python, a list is an ordered collection of items (which can be of different data types), while a set is an unordered collection of unique items (which can only be of immutable data types like integers, strings, etc.). Lists allow duplicate items and maintain their order, while sets do not allow duplicate items and do not maintain any specific order.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is list in python?

1 Answers  


What is the output of the below program?

1 Answers  


Why do we need operator overloading?

1 Answers  


What is anaconda program?

1 Answers  


Tell me about a few string operations in python?

1 Answers  


Why python is called python?

1 Answers  


How do you invoke the python interpreter for interactive use?

1 Answers  


What is the shortest method to open a text file and display its content?

1 Answers  


What is sub() function?

1 Answers  


How to get the current time in python?

1 Answers  


What is decorators?

1 Answers  


What is split() function?

1 Answers  


Categories