If you're stuck on how to get started, follow this step-by-step road map.
for word in list_of_words: word = word.lower()since you're just changing the temporary reference your loop variable has. The values in the original list remain unchanged! This, on the other hand, would probably accomplish what you want:
for i in range(len(list_of_words)): list_of_words[i] = list_of_words[i].lower()
unigrams = { 'one':1, 'two':2, 'thirteen':13 }I could generate a random unigram — with a 1⁄15th chance of being "one", a 2⁄15th chance of being "two", and a 13⁄15th chance of being "thirteen" — this way:
a_random_unigram = random.choices(list(unigrams.keys()), weights=list(unigrams.values())