题目:We have provided a file called emotion_words.txt that contains lines of words that describe emotions. Find the total number of words in the file and assign this value to the variable num_words.
emotion_words = open('emotion_words.txt','r')
chars = emotion_words.read()
chars = chars.split()
num_words = len(chars)
print(num_words)