From the course: Transition from C# to Python

Unlock the full course today

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

Dictionaries

Dictionaries

From the course: Transition from C# to Python

Start my 1-month free trial

Dictionaries

- [Instructor] Another fairly common data structure used in programming is the dictionary. And of course, C sharp provides comprehensive support for this class. So in the dictionaries folder, let's open up the C sharp example first. And then similar to the arrays and lists example, we're going to take a look at a C sharp example and then go and convert it to Python. So dictionaries sometimes go by other names, like, hash tables, or whatnot. But what they essentially do is associate a unique key with a value. So in this C sharp example, we're using a dictionary to associate file extensions with their descriptions. And the rest of the code illustrates how to perform some basic operations, such as finding out how many items are in the dictionary, and we can see how to add items, we can check to see if the dictionary contains a specific key or contains a specific value, we can remove items, so here we're…

Contents