Question d’entretien chez Nokia

Whats the difference between list and dictionary in python?

Réponse à la question d'entretien

Utilisateur anonyme

16 juill. 2019

Both are python data structures that store elements .The difference is list is represented as follow l1 = [1,2,3," example"] where we can access list elements using indexing dictionary is represented with key ,value pairs like follow dict1 = {ïd": "123","name" : " Indu" ,"surname" :"petapalle"} the elements can be accessed like print dict1["name"] this will print " Indu"

1