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 |
What is list in python?
What is the output of the below program?
Why do we need operator overloading?
What is anaconda program?
Tell me about a few string operations in python?
Why python is called python?
How do you invoke the python interpreter for interactive use?
What is the shortest method to open a text file and display its content?
What is sub() function?
How to get the current time in python?
What is decorators?
What is split() function?