Lists of Lists

From Observation Notes Analysis: U3L4: "There is time being wasted creating list {list{_,_,_}, list{_,_,_}, list{_,_,_}, list{_,_,_}, list{_,_,_}, list{_,_,_}, list{_,_,_}, list{_,_,_}} Handling the block input slots and expander arrows is a time sink." [This note was from Magic Squares, which is now gone, but it's worth being mindful of elsewhere.]

Here are three lists of lists: one is a list of world capitals and their countries; one is a list of showtimes on the four screens of a movie theater; and one is a to-do list with categories:
list {{Quito, Ecuador}, {Copenhagen, Denmark}, etc.}
list {{6:15, 9:15}, {4:45, 7:30, 10:15}, etc.}
list {trash, {eggs, cucumbers, juice, bread}, practice, plants, etc.}

  1. Load the project above by clicking on the picture.
  2. Experiment with list operations like length of and item () of {} to learn how they treat lists of lists.
  3. Predict What Will Happen
  4. Does this expression report 8 or 16? Make a guess first, and then build it to check.
    length of list {{Quito, Ecuador}, {Copenhagen, Denmark}, etc.}
  5. What will this expression report? Why? Talk with Your Partner Build and run it in Snap!
    item (2) of (list {{6:15, 9:15}, {4:45, 7:30, 10:15}, etc.})
  6. Does this expression all but first of item (1) of (list {{6:15, 9:15}, {4:45, 7:30, 10:15}, etc.}) report 9:15, the list {9:15}, or {4:45, 7:30, 10:15}?
    {4:45, 7:30, 10:15} is how we represent picture of gray rounded rectangle with 4:45, 7:30, and 10:15 in smaller red rounded rectanges with text.
  7. Talk with Your Partner What will this expression report? Why? Build and run it in Snap!
    item (3) of (list {Augusta, {Boise, Columbia, Des Moines}})
  8. Determine what each of the following expressions will report without building them in Snap!
    item (1) of (item (2) of (list {{Quito, Ecuador}, {Copenhagen, Denmark}, etc.}))
    item (2) of (item (1) of (list {{Quito, Ecuador}, {Copenhagen, Denmark}, etc.}))
  9. What numbers belong in the two blanks in the item of blocks to make this expression report 8:30?
    item () of (item () of (list {{6:15, 9:15}, {4:45, 7:30, 10:15}, etc.}))
    Build it in Snap! to check.