Lists and Dictionaries, a Refresher

Lists and Dictionaries, a Refresher: Lists: Keeping Things in Order, Dictionaries: Looking Things Up by Name, Looping Through Dictionaries and Nested Data.

Updated

  1. Lists: Keeping Things in Order (Novice): A list keeps many values in order under one name, so you can read any item by its index, counting from 0 at the front or from -1 at the back, add, insert and remove items, and check whether a value is there with in.
  2. Dictionaries: Looking Things Up by Name (Novice): A dictionary stores each value under a key you choose, so a program finds a value by its name instead of its position, and adds, changes and removes entries as the data changes.
  3. Looping Through Dictionaries and Nested Data (Apprentice): A for loop goes through a dictionary's keys, items(), keys() and values() give its pairs, its keys or its values, and lists of dictionaries and dictionaries of lists hold whole tables of data, the shape CSV files and web APIs give you.