I want to access the value of the term 'just' but somehow it gives the error: 'NoneType' object is not subscriptable. How can I solve this
def count_words(word_list):
"Count word frequencies of words in a list."
cnt_dict = dict()
for word in word_list:
if word in cnt_dict:
cnt_dict[word] += 1
else:
cnt_dict[word] = 1
print(cnt_dict)
my_words = ['this', 'is', 'just',
'a', 'test', 'example', 'to',
'test', 'some', 'example', 'code']
cnt = count_words(my_words)
cnt['just']