From the course: Python Data Structures: Dictionaries

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Iterating through a dictionary

Iterating through a dictionary - Python Tutorial

From the course: Python Data Structures: Dictionaries

Start my 1-month free trial

Iterating through a dictionary

- [Instructor] As I mentioned in one of my earlier videos, we are going to use the Sublime Editor to run Python programs and edit them. So let's move on to the Python editor. Here in the editor, we are going to first try and create a dictionary. We can also create Python dictionaries by using the result word D-I-C-T, dict, for creating a dictionary. Let's start with sal_info=dict, parentheses. We're using the same example that we have used in the previous lessons, to illustrate how to use Sublime Editor. In our dictionary, we are going to have the salaries of the software engineer's average earnings in major cities in the USA. The cities are the keys, and the average salaries are their values. So let's see, here we have an empty dictionary. Let's print it, let's go to Tools and click Build. And we print an empty dictionary. Now let's say we are going to populate this. We do sal_info=,open braces. I am pre-populating…

Contents