From the course: Python for Non-Programmers
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
Dictionaries - Python Tutorial
From the course: Python for Non-Programmers
Dictionaries
- [Host] Now we're going to start learning about dictionaries, which, dictionaries, are very similar to lists in some ways, but also have some key differences. I like to call them cousins because they're related, but they're not exactly the same. So dictionaries get their name from a dictionary. Just like you would think, like the physical book where you look up a word and then it gives you the definition of that word. So with dictionaries, they're called a key value pair, where in the example of the dictionary, the word that you're looking up is the key and the definition is the value. So let me go ahead and walk through an example, and I think this will start to make sense. So let's say we have a bunch of cats and we want to categorize them based off their age. Well, let's go ahead and create a variable called "cats" and to make a dictionary in Python, we're going to do curly brackets. So with lists, we do square…