Tubles
Tubles - more
- Return more than one value from a function
Lists
Functions as Objects
first class objects:
Generalization of HOPs
Dictionary
Store pairs of data:
Dictionary lookup
Dictionary - values
Dictionary - keys
list
vs
dictionary
lists: - ordered, look-up by int. index, indices have an order, index is an integer dict: - matches 'keys' to 'values' - look-up one item by another item - no order is guaranteed - key can be any immutable type
global variables
can be dangerous
- breaks the scope
- allows for side effects
BUT can be convenient when want to keep track of information inside a function