Let's say myDict
has five key-value pairs. How can we retrieve the fifth value?
print(myDict["E"])
print(myDict[4])
print(myDict[6])
Perfect! Dictionaries are unordered, which means that values don't have indices. If we want to access the a value, we need to know its key.
Oh noes! Dictionaries are unordered, which means that values don't have indices. If we want to access the a value, we need to know its key.