import string
palavras = "nos, a, preste"
texto = "Ao nos resolver a esta tarefa, preste nos atenção nos seguintes a nos pontos:"
palavras_spl = palavras.translate(palavras.maketrans('','',string.punctuation)).lower().split()
text_spl = texto.translate(texto.maketrans('','',string.punctuation)).lower().split()
count = {p: text_spl.count(p) for p in palavras_spl if p in text_spl}
print(count) # {'preste': 1, 'a': 2, 'nos': 4}
aW1wb3J0IHN0cmluZwoKcGFsYXZyYXMgPSAibm9zLCBhLCBwcmVzdGUiCnRleHRvID0gIkFvIG5vcyByZXNvbHZlciBhIGVzdGEgdGFyZWZhLCBwcmVzdGUgbm9zIGF0ZW7Dp8OjbyBub3Mgc2VndWludGVzIGEgbm9zIHBvbnRvczoiCgpwYWxhdnJhc19zcGwgPSBwYWxhdnJhcy50cmFuc2xhdGUocGFsYXZyYXMubWFrZXRyYW5zKCcnLCcnLHN0cmluZy5wdW5jdHVhdGlvbikpLmxvd2VyKCkuc3BsaXQoKQp0ZXh0X3NwbCA9IHRleHRvLnRyYW5zbGF0ZSh0ZXh0by5tYWtldHJhbnMoJycsJycsc3RyaW5nLnB1bmN0dWF0aW9uKSkubG93ZXIoKS5zcGxpdCgpCmNvdW50ID0ge3A6IHRleHRfc3BsLmNvdW50KHApIGZvciBwIGluIHBhbGF2cmFzX3NwbCBpZiBwIGluIHRleHRfc3BsfQpwcmludChjb3VudCkgIyB7J3ByZXN0ZSc6IDEsICdhJzogMiwgJ25vcyc6IDR9