Changes

Jump to: navigation, search

OPS435 Python Lab 4

2 bytes added, 17:20, 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; instead, - they are "views of the dictionary" and therefore are immutable.<br><br>On the other hand, you can 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