Collections


About Collections

for element in collection:
    do something with the element

About Sequences

/ * sequence[i:j] to retrieve a subsequence from index i through j, not including j

Collection literals

Casting and concatenating collections

About dicts

flora_to_color = { 'spruce': 'green', 'apple': 'red', 'shamrock': 'green',

  'banana': 'yellow', 'potato': 'brown', 'eggplant': 'purple' }

flora_to_color[ 'lemon' ] = 'yellow'