Write a program to find the frequency of words present in a string


Topic: Write a program to find the frequency of words present in a string

Solution

  
test_str = 'times of india times new india express'
print("The original string is : " + str(test_str)) 
res = {key: test_str.count(key) for key in test_str.split()} 
print("The words frequency : " + str(res))



List all Python Programs