June 2017
Beginner
352 pages
8h 39m
English
We'll now return to dictionaries, which lie at the heart of many Python programs, including the Python interpreter itself. We briefly looked at literal dictionaries previously, seeing how they are delimited with curly braces and contain comma-separated key value pairs, with each pair tied together by a colon:
>>> urls = {'Google': 'http://google.com',... 'Twitter': 'http://twitter.com',... 'Sixty North': 'http://sixty-north.com',... 'Microsoft': 'http://microsoft.com' }>>>
A dictionary of URLs. The order of dictionary keys is not preserved, refer to the following diagram:

The values are accessible via the ...
Read now
Unlock full access