# Defined a Class print the Particular character in CountWord
def countWord(string):
d = {}
for word in string:
try:
d[word] += 1
except:
d[word] = 1
for k in d:
print "%s: %d" % (k, d[k])
print countWord("Hello I myself vishal and I am to going to I with Hello am")I have create a class and print particular word by word showing in output.
