Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

In Python which is better to use dictionary or lists?

+2 votes
asked Jul 3, 2019 by Danny

4 Answers

0 votes
answered Jul 16, 2019 by aravind (140 points)
based on our requriment we will use dict or list

dict is data type which contain key:value

but list contains only values

both are mutable
0 votes
answered Jul 18, 2019 by Randhir Gurjar
in python both are good at the respective places but dictionary in terms options is generally considered better.
0 votes
answered Jul 18, 2019 by DEEPAK kumar (140 points)
best dictionary
0 votes
answered Jul 21, 2019 by sahdev (180 points)
It will depend on what you want them for. For example to create a binary tree you can use list, but for graph a dict is more suitable.

Dict in very simple way is used as a hash table as well.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...