from collections import Counter
def popularidade (texto, palavras):
texto = texto.lower().split()
palavras = palavras.lower().replace(',', '').split()
lista = []
for p in palavras:
for t in texto:
if p == t:
lista.append(t)
return Counter(lista)
print(popularidade("Ao nos resolver a esta tarefa, preste nos atenção nos seguintes a nos pontos:", "nos a preste"))
ZnJvbSBjb2xsZWN0aW9ucyBpbXBvcnQgQ291bnRlcgoKZGVmIHBvcHVsYXJpZGFkZSAodGV4dG8sIHBhbGF2cmFzKToKCiAgICB0ZXh0byA9IHRleHRvLmxvd2VyKCkuc3BsaXQoKQogICAgcGFsYXZyYXMgPSBwYWxhdnJhcy5sb3dlcigpLnJlcGxhY2UoJywnLCAnJykuc3BsaXQoKQoKICAgIGxpc3RhID0gW10KCiAgICBmb3IgcCBpbiBwYWxhdnJhczoKICAgICAgICBmb3IgdCBpbiB0ZXh0bzoKICAgICAgICAgICAgaWYgcCA9PSB0OgogICAgICAgICAgICAgICAgbGlzdGEuYXBwZW5kKHQpCiAgICByZXR1cm4gQ291bnRlcihsaXN0YSkKCnByaW50KHBvcHVsYXJpZGFkZSgiQW8gbm9zIHJlc29sdmVyIGEgZXN0YSB0YXJlZmEsIHByZXN0ZSBub3MgYXRlbsOnw6NvIG5vcyBzZWd1aW50ZXMgYSBub3MgcG9udG9zOiIsICJub3MgYSBwcmVzdGUiKSk=