Python List Exercises
From WLCS
Objectives
- You will learn to create lists
- You will learn to access elements (things) in a list
- You will learn to traverse (walk through) a list using a loop
Resources
Directions
Create a file name "ch9_yourLastName.py". In your file, complete the following exercises:
- Create a list named wordList that contains the following words: "washington", "lee", "generals", "arlington", "virginia"
- Print out the first element in wordList
- Print out the length of the list by using len(wordList)
- Print out the last element in wordList by using wordList[len(wordList)-1]
- Print out the word "generals" in the list