Changes

Jump to: navigation, search

OPS435 Python Lab 4

1 byte removed, 14:14, 15 June 2017
PART 3 - Dictionaries
== PART 3 - Dictionaries ==
::By now, you have probably been exposed to database terminology. For example, a database is a collection of related records. In turn, records are a collection of related fields. In order to access a record in a database, you would need to access it by '''key field(s)'''. In order words, those key field(s) are a '''key that unlocks the access to a record''' within a database.
::In Python, a '''dictionary''' is a set of key-value pairs. Dictionaries are '''unordered''', like sets, however any value can be retrieved from a dictionary if you know the key. This section will go over how to create, access, and change dictionaries, providing a new powerful tool to store and manipulate data.
::'''Perform the Following Steps:'''
::#Launch the ipython3 shell:<source>
ipython3
list_of_keys[0]
list_of_values[0]
</source>::#By using this generated list of indexes, we are able to pair the keys and values of two separate lists.<br><br>
::#For example, issue the following:<source>
list_of_keys = list(dict_york.keys())
13,420
edits

Navigation menu