Week 4: Python Data Structures
[]
.()
.(x, y)
or rgb color values (255, 0, 0)
.my_list[0]
gets the first item.my_list[-1]
gets the last item.my_list[1:4]
gets the items from index 1 up to (but not including) index 4.key: value
pairs.{}
.{}
, but they are not key-value pairs.list
when you need an ordered collection of items that you might need to change later.tuple
when you have an ordered collection of items that should never change.dict
when you need to store and retrieve data by a unique key.set
when you need to store a collection of unique items and don’t care about their order.labs/lab04/README.md
for full instructions.IS4010: App Development with AI