what is the use of dictionary in python..... because there are lists also available in python so why don't we use them instead of dictionary. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what is the use of dictionary in python..... because there are lists also available in python so why don't we use them instead of dictionary.

31st Jul 2016, 10:39 AM
Aakash Sharma
Aakash Sharma - avatar
1 Answer
+ 1
This comes down to query speed and the concept of "BigO" which will be visited in later lessons. In short, querying dictionaries in Python is much faster than querying lists. http://stackoverflow.com/questions/513882/python-list-vs-dict-for-look-up-table
31st Jul 2016, 5:30 PM
SouthBay
SouthBay - avatar