Changes

Jump to: navigation, search

OPS435 Python Lab 4

No change in size, 17:23, 15 June 2017
PART 3 - Dictionaries
dict_york.values()
dict_york.keys()
</source>You should notice that key value for 'Province' has been changed back to 'ON'.<br><br>These lists that contain the values and keys of the dictionary are not <u>real</u> python lists - they are "views of the dictionary" and therefore are immutable.<bru>immutable<br/u>. You could change these views into usable lists by using the '''list()''' function (where the index can be used to access individual values).<br><br>
::#For example, issue the following:<source>
list_of_keys = list(dict_york.keys())
13,420
edits

Navigation menu