Here is what my current list looks like:
wordOccur = ['tears', 1, 'go', 1, 'i', 4, 'you', 7, 'love', 2, 'when', 3]
This is how I created it:
wordOccur = []
for x in keywords:
count = words.count(x)
wordOccur.append(x)
wordOccur.append(count)
the term words refers to a list of strings. Each string is a singular word from a poem
How do I make wordOccur = [['tears', 1], ['go', 1],[ 'i', 4],[ 'you', 7],[ 'love', 2],[ 'when', 3]]
?