Question: I have a trouble counting words in a list.

```
My_list = ["white is a colour", "orange is a fruit", "blue is a mood", "I like candy"]

```

What I need the script to output is the number of words in the list (15 in this case).

```
len(My_list)

```

will return "4" (the number of items).

```
for item in My_list:
    print len(item.split())

```

will give me length of each item. 

Is there a way to get the word count from a list?
Ideally, I would also like to append each word into a new list (each word is an item).

Answer: 
List comprehension is a very good idea. Another way would be to use join and split:

```
l = " ".join(My_list).split()

```

Now 'l' is a list with all the word tokens as items and you can simply use len() on it:

```
len(l)

```
```
My_list = ["white is a colour", "orange is a fruit", "blue is a mood", "I like candy"]

word_count = 0
for phrase in My_list:
    # increment the word_count variable by the number of words in the phrase.
    word_count += len(phrase.split())

print word_count

```