What is difference between set and list in python?



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

Answer / Sachin Kant Siddharth

In Python, a list (list) is an ordered collection of elements, which can contain duplicate values. A set (set) is an unordered collection of unique elements with no defined order. Sets are more efficient for operations like membership testing, intersection, union, and difference.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is the procedure to extract values from the object used in python?

1 Answers   LeapZen,


Explain how you can access sessions in flask?

1 Answers  


Does python perform tail recursion optimization?

1 Answers  


Should I learn python or scala?

1 Answers  


How does python handle compile-time and run-time code checking?

1 Answers  


How do you include a module in your python file?

1 Answers  


What is the difference between local vs global in python?

1 Answers  


How do I run a python script?

1 Answers  


What is string replication operator in python?

1 Answers  


Is pypy faster than python?

1 Answers  


Is python a compiled or interpreted language?

1 Answers  


What does .join mean in python?

1 Answers  


Categories