Practice with Index Variables
As we have seen in the previous section, we generally use an index variable to process the elements of a list. Below, we have reproduced the script that makes the character
say the names of the players in a list.
Modify the script to make the character
say the following:
- Every other name in a list.
- Every third name in a list.
- Names in a list in reverse order.
- Names in a list that start with the letter
- Names that are longer than four letters.