Native Python Data Structures



Overview



List, Tuple and Dictionary are of Collection type and are included in native Python package
• A Collection type is a data type that made up of other objects

Name - type()ExampleNotes
list['a', 1, 18.2]Ordered list of items (~ Arrays) Mutable (can be changed after created) Items can be different data types Can contain duplicate items
tuple('a', 1, 18.2)Just like a list; except: Immutable (cannot be changed)
dict{"apples": 5, "pears": 2, "orange": 9}}Unordered key-value pairs Keys don’t have to be same data type Values don’t have to be same data type Keys are unique; must be immutable


Index