Write Python function to Count the Frequency of Words Appearing in a String Using a Dictionary


Topic: Write Python function to Count the Frequency of Words Appearing in a String Using a Dictionary

Solution

def countword(test_string):
	l=[]
	l=test_string.split()
	wordfreq=[l.count(p) for p in l]
	return(dict(zip(l,wordfreq)))
	
	
	



List all Python Programs