This program is written in the Python programming language and it counts the frequency of each word in a given string. It does this in three steps:
Finally, the program prints the dictionary "c", which contains the frequency of each word in the input string.
str = "To change the overall look your document. To change the look available in the gallery" c = dict() txt = str.split(" ") for t in txt: if t in c: c[t] += 1 else: c[t] = 1 print(c)
{'To': 2, 'change': 2, 'the': 3, 'overall': 1, 'look': 2, 'your': 1, 'document.': 1, 'available': 1, 'in': 1, 'gallery': 1}
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions