def retirar(texto, careteres):
for c in careteres:
texto = texto.replace(c, '')
return texto
lista = ["dia", "noite", "tarde", "é", "está", "bonito", "o", "a", "muito", "feio"]
texto = "Hoje é sábado, vamos sair pois o dia está bonito. Até mais tarde."
frase = []
texto2 = retirar(texto, ".,");
for palavra in texto2.split(' '):
if palavra in lista:
frase.append(palavra)
print (' '.join(frase))
ZGVmIHJldGlyYXIodGV4dG8sIGNhcmV0ZXJlcyk6CiAgICBmb3IgYyBpbiBjYXJldGVyZXM6CiAgICAgICAgdGV4dG8gPSB0ZXh0by5yZXBsYWNlKGMsICcnKQoKICAgIHJldHVybiB0ZXh0bwogICAgICAgIAoKbGlzdGEgPSBbImRpYSIsICJub2l0ZSIsICJ0YXJkZSIsICLDqSIsICJlc3TDoSIsICJib25pdG8iLCAibyIsICJhIiwgIm11aXRvIiwgImZlaW8iXQp0ZXh0byA9ICJIb2plIMOpIHPDoWJhZG8sIHZhbW9zIHNhaXIgcG9pcyBvIGRpYSBlc3TDoSBib25pdG8uIEF0w6kgbWFpcyB0YXJkZS4iCgpmcmFzZSA9IFtdCgp0ZXh0bzIgPSByZXRpcmFyKHRleHRvLCAiLiwiKTsKCmZvciBwYWxhdnJhIGluIHRleHRvMi5zcGxpdCgnICcpOgogICAgaWYgcGFsYXZyYSBpbiBsaXN0YToKICAgICAgICBmcmFzZS5hcHBlbmQocGFsYXZyYSkKCnByaW50ICgnICcuam9pbihmcmFzZSkpCg==