I&C SCI 31 Chapter Notes - Chapter 6: Key 2, Subset, Symmetric Difference

37 views7 pages

Document Summary

Want to access list items using user-defined indexes such as strings. A dictionary is a container that stores items that are accessible using user-specified indexes. First part are indexes, after colon are values. The dictionary employee differs from a list in that an item in a dictionary is accessed using a user- specified index rather than the index representing the item"s position in the container. The python dictionary type, denoted dict, is a container type, like str and list. The general format of the expression that evaluates to a dictionary object is: {:, :,, ,} The key and value are both objects. Key is the index that is used to access the value. 100-01-0010" is the key, [ hans", castorp"] is the value. The pairs are separated by commas and enclosed curly braces. The key and value are separated by a colon.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents