+ 1
Dictionaries
>>> insects = {"Dragonfly": 5000, "Praying Mantis": 2000, "Fly": 120000, "Beetle": 350000} >>> insects["Grasshopper"] = 20000 >>> insects 1 - {"Dragonfly": 5000, "Praying Mantis": 2000,"Fly": 120000, "Beetle": 350000â, Grasshopperâ : 20000} 2 - {"Dragonfly": 5000, "Praying Mantis": 2000,"Fly": 120000,Grasshopperâ : 20000, "Beetle": 350000â} my response is 1 but response teacher is 2. who Wrong ??
1 Answer
+ 1
Dictionaries don't have any order to them whatsoever. When you add anything, it is inserted in random place
Try this code in the playground and see for yourself.