from re import findall
def frequency(string):
palavras = findall(r"\w+", string)
dicionario = {}
for w in palavras:
if w in dicionario:
dicionario[w] += 1
else:
dicionario[w] = 1
return dicionario
string = "leilão leilão"
print(frequency(string))
ZnJvbSByZSBpbXBvcnQgZmluZGFsbAoKZGVmIGZyZXF1ZW5jeShzdHJpbmcpOgogICAgcGFsYXZyYXMgPSBmaW5kYWxsKHIiXHcrIiwgc3RyaW5nKQogICAgZGljaW9uYXJpbyA9IHt9CiAgICBmb3IgdyBpbiBwYWxhdnJhczoKICAgICAgICBpZiB3IGluIGRpY2lvbmFyaW86CiAgICAgICAgICAgIGRpY2lvbmFyaW9bd10gKz0gMQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGRpY2lvbmFyaW9bd10gPSAxCiAgICByZXR1cm4gZGljaW9uYXJpbwoKCnN0cmluZyA9ICJsZWlsw6NvIGxlaWxhzINvIgpwcmludChmcmVxdWVuY3koc3RyaW5nKSk=