Dictionary in Python:
1. Dictionary in python maps name to values. Names are called keys. It can also be a number or any object which is hashable (can be converted to number).
2. Dictionary have keys and values. It can be looped in three ways.
On dict.keys , dict.values , or dict.items
3. Keys and values don't come in alphabetical order. Which means index is not guaranteed for
Python dictionary.
4. They are widely used to collect data items of different kind and where sequence or order is not expected.
5. Denoted by { }
-- Notes from classes of Michele Vallisneri
1. Dictionary in python maps name to values. Names are called keys. It can also be a number or any object which is hashable (can be converted to number).
2. Dictionary have keys and values. It can be looped in three ways.
On dict.keys , dict.values , or dict.items
3. Keys and values don't come in alphabetical order. Which means index is not guaranteed for
Python dictionary.
4. They are widely used to collect data items of different kind and where sequence or order is not expected.
5. Denoted by { }
-- Notes from classes of Michele Vallisneri
No comments:
Post a Comment