Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 4

4 bytes removed, 08:15, 21 June 2017
PART 3 - Dictionaries
print(value)
</source>Additional Information regarding Dictionaries:<ul><li>The values and keys can be looped over using the index as well
::#The '''range()''' function provides a list of numbers in a range.</li><li>The '''len()''' function provides a the number of items in a list.</li><li>Used together '''len()''' and '''range()''' can be used to create a list of usable indexes for a specific list</li></ul><br><br>Let's create a dictionary by using lists in order to store our dictionary data. First, we need to pair the keys and values of two separate lists.<br><br>
::#Issue the following:<source>
list_of_keys = list(dict_york.keys())
13,420
edits