7 ответов
+ 2
i like to think of dictionaries as a big box with a bunch of smaller boxes inside, each labeled.
Theres no rhyme or reason how they are put in there so its not naturally ordered.
to access, the contents you want, you'll need to know the label name. the label is the key and the contents is the value in the key:value pair.
say if you worked at a shelter, you can have a dictionary called "animals". in that dictionary you can put animal types (dog, cat, pig, whatever) as the keys. Just string values as labels that point to the value, probably how many you have of each
+ 7
Here are some basic tutorials from sololearn about dictionary:
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2450/
https://www.sololearn.com/learn/Python/2451/
+ 5
It is just like your English dictionary where we store a key with its value whenever we require to see the value then we need to search for key
Ex
D = {key:value,key:value}
D[key] will give value
+ 4
Complete the lesson here....
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2450/
0
Dictionaries are just like lists. But in dictionaries we have to assign the elements to something known as keys while in lists, the elements are automatically indexed.
0
this was totally hard, thanks