What Is The Difference Between List And Dictionary In Python?

What Is The Difference Between List And Dictionary In Python?
Share

1 Answer

  1. List is an ordered form of data structure whereas dictionary is an unordered form of data structure. So when you add an item in a list it is added in a particular sequence but in dictionary the item is added randomly at any position.
    Dictionary stores items in key-value pairs and lists store it at indices.
    To access items in list, you refer to indices but in dictionaries you refer to key for accessing the stored value against it.

    • 0

Leave an answer

You must login to add an answer.