Difference between list, tuple, set, and dictionary in python?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: PythonDifference between list, tuple, set, and dictionary in python?
Chetan Shidling Staff asked 5 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 5 years ago

The difference between list, tuple, set, and the dictionary is:

  1. The list is a collection that is ordered and changeable. Allows duplicate members.
  2. A tuple is a collection that is ordered and unchangeable. Allows duplicate members.
  3. Set is a collection that is unordered and unindexed. No duplicate members.
  4. Dictionary is a collection that is unordered, changeable, and indexed. No duplicate members.