I think you want to use new_sentence (and is one of the positive results of posting code).
def wordFrequences(new_sentence):
wordFreq = {}
## new_sentence was not defined
split_sentence = new_sentence.split()
for word in split_sentence:
wordFreq[word] = wordFreq.get(word,0) + 1
wordFreq.items()
print wordFreq
sentence = "The first test of the function"
new_sentence = removePunctuation(sentence)
wordFrequences(new_sentence)
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714