课程: Programming Concepts for Python

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Dictionaries

Dictionaries

- Before the days of the internet, when you wanted to look up the meaning of a word, you could look it up in a dictionary like this one. This dictionary holds thousands of definitions in it, and I can find the definition I'm looking for very quickly because I can index it using the associated word. In the programming world, dictionary is a term that's used to describe a data structure that stores a collection of key and value pairs. You might also hear words like map, symbol table or hash table, which also accomplish the same thing. Just like with a real-life dictionary, I can look up values quickly by using the associated keys. Fortunately, programming dictionaries aren't limited to just storing words and definitions. Time to invite my friends over. Now, some people might call me old-fashioned, but I like to keep track of my friends' phone numbers in my trusty old pen and paper Rolodex. My Rolodex is just like a…

内容