One of the most common ways to store data is in a dictionary or in a data frame (you will learn about the data frame in later modules). So it is important to have a good grasp of iterating through dictionary keys and values. Please have a look at the coding quiz question below before you proceed to see Sajan solve it. Feel free to attempt it before you watch the video.
You saw Sajan build pseudocode for the problem at hand. Can you try and solve it now? Sajan, in the next video, will also demonstrate how to convert this to code.
In this segment, you learned how to iterate on the keys and the values of the dictionary. You can iterate on values in two ways, by using dict.values() and also by iterating on dict.keys() and using dict[k] to access the value of key k. Choosing what way to traverse through the dictionary will be crucial and will change with your objective for the same.
In the next segment, you will build a strong sense about dictionary key and value.