Lists

Students will...

  1. be able to use the terms list and elements properly.
  2. be able to create lists using the literal method:
    e.g., cheeses = ['cheddar', 'jarlsberg', 'Venezuelan beaver cheese']
  3. be able to discuss sublists and nested lists.
  4. understand the difference between creating a list and indexing into a list.
  5. be able to write code using in and not in on lists.
  6. understand using + with lists.
  7. be able to use slicing to create a new list from an existing list.
  8. discuss the implications of the fact that a list is mutable.
  9. understand aliasing.
  10. be able to use the methods append(), extend(), insert(), pop(), sort(), count().
  11. be able to write code to do an index-based or item-based traversal of a list.
  12. be able to use lists as parameters, return values, etc.
  13. be able to use split() to split a string into a list of strings.
  14. understand how a tuple differs from a list.
  15. be able to write code to use multiple-assignment using a tuple.
  16. be able to write code to return a tuple from a function, and capture those return values in a tuple of variables.