How does a counting loop with exactly two cases turn a page of lyrics into a dictionary of word frequencies?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
The test song is short, repetitive, and written entirely in capitals. Its punctuation was stripped beforehand, because stray commas would corrupt the counts:
song = "RAH RAH AH AH AH ROM MAH RO MAH MAH"
Assign to words_list that song's words as a list, with every letter in lowercase — the ten-element list the counting loop will later walk over. Capitals have to go, so that a capitalised word and a lowercase one count as the same word.
(Hint: one string method returns an all-lowercase copy, and another breaks a string into a list of words when called with nothing inside the parentheses: .lower() and .split().)