Chapter 3 exercises and tests for list functions