I'm trying to count the length of each word in a string of text and then count the frequency of times that number of characters shows up throughout the entire text. I can't seem to figure out where to go from what I have here. Any help is greatly appreciated.
import sys
text = "This is an example of a long text of which I am trying to count word lengths and the frequency of each length."
word_list = []
text = text.join().strip()
for punc in "!',?;.":
text = text.replace(punc, "")
while True:
words = text.lower().split()
for word in words:
word_count = len(word)
word_list.append(word_count)