|
Dictionaries are mutables and support mutable functions. But this is a case where dictionaries are slightly different from lists. We are allowed to loop over a dictionary as we modify it, so long as…
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
Since we can loop over dictionaries, that means we probably want to use them in functions with accumulators. In this video we show how to do this and why they are not that much different from lists.
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|
|
In this video, we introduce a dictionary as a collection of key-value pairs. We also show how to write a dictionary expression in Python. It looks just like a JSON string, but without the quotes.
Content Categories
Instructional Recordings Creation Date
October 27th, 2020 Creator 1 First Name
Walker Creator 1 Last Name
White Creator 1 Role
Faculty or Staff Member Creator 1 NetID
wmw2 Language
English Searchable
Yes Searchable On
Cornell Web Search
|