This is a free preview lesson of this course. Sign in to access it.
This lesson is a part of the course Python for Data Science
Ask questions about this lesson and get instant answers.
In this lesson, we will learn about a new data type in Python called Dictionaries. Dictionary is one of the most powerful data structures in Python. To understand what dictionaries are, let’s take an example.
Let’s say that an investor holds five stocks in his stock portfolio and he tallies the latest prices for each of these stocks. Let’s say the stocks are Google (GOOGL), Facebook (FB), Microsoft (MSFT), Apple (AAPL), and Amazon (AMZN). In Python, we can create a list to store the stock prices as shown below: