From the course: Get Ready for Your Coding Interview

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Overview of dictionary/hash table

Overview of dictionary/hash table

- [Instructor] Here's a quick overview of dictionary in Python. In other languages like Java, it's often known as hash tables. This is one of the most commonly used types in Python. And it's useful in many different types of coding interview problems as well. So let's get right into it. Now, here's how a regular Python dictionary works. You basically have pairs of words and definitions in the dictionary. You might ask, what does the word apple mean? And it has a corresponding definition. The round red fruit of a tree. The Python dictionary, or hash table in other languages works in very much the same way. Instead of words and definitions, we have keys and varies. In this Python dictionary for example, we have a string apple as a key, and we can ask the dictionary, what's the corresponding value for the key apple. And it'll give us a value. The round red fruit of a tree, which is also a string. The values could…

Contents