def word_count(mystr):
myl = mystr.lower().split()
dic = {}
for value in myl:
if dic.has_key(value):
dic[value]+=1
else:
dic[value]=1
return dic
print word_count("The cat sat at the mat")
ZGVmIHdvcmRfY291bnQobXlzdHIpOgogICAgbXlsID0gbXlzdHIubG93ZXIoKS5zcGxpdCgpCiAgICBkaWMgPSB7fQogICAgZm9yIHZhbHVlIGluIG15bDoKICAgICAgICBpZiBkaWMuaGFzX2tleSh2YWx1ZSk6CiAgICAgICAgICAgIGRpY1t2YWx1ZV0rPTEKICAgICAgICBlbHNlOgogICAgICAgICAgICBkaWNbdmFsdWVdPTEKICAgIHJldHVybiBkaWMKcHJpbnQgd29yZF9jb3VudCgiVGhlIGNhdCBzYXQgYXQgdGhlIG1hdCIp