print a random word from list python

import random

words = ['tree','sun','ball','moon','earth','grass','world'] 

word = random.choice(words)
print(word)

Here is what the above code is Doing:
1. It’s creating a list of words.
2. It’s choosing a random word from the list.
3. It’s printing the word.