import string
lyric ="In 1845, when he was 28 years old Thoreau spent two years Jane in the beautiful environment of the Walden woods"
words =[word.strip(string.punctuation).lower()for word instr(lyric).split()]
word_dict={}for word in words:if word in word_dict:
word_dict[word]+=1else:
word_dict[word]=1print(word_dict)