Write a Python program to count Please include comments and

Write a Python program to count. Please include comments and screenshots, thank you!

1.)the frequency of words in a file (hint: use Counter module)

2.)the sentences

3) the words

Solution

file=open(\"C:\\\\file.txt\",\"r+\") wordcount={} for word in file.read().split(): if word not in wordcount: wordcount[word] = 1 else: wordcount[word] += 1 for k,v in wordcount.items(): print k, v
Write a Python program to count. Please include comments and screenshots, thank you! 1.)the frequency of words in a file (hint: use Counter module) 2.)the sente

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site