10/14


#1


if accessing dictionary values by key is similar to list by refering to indexes, then how come i cant just print the sloth and burmese python by print residents[‘sloth’: ]


#2

the syntax is similar, except we use a key instead of an index. That is pretty much where the similarity ends.

Dictionaries are unordered by nature, where list are ordered. So in dictionaries, there is no way we can use slices, given we won’t know the order of the dictionary, as such, there is no slice for dictionary in the python language


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.