def sms_from_str(s: str) -> str:
words = [
"igual",
"mas",
"menos",
"masa",
"adios",
"ademas",
"aca",
"bien",
"bueno",
"gracias",
"que",
"te",
"cuanto",
"nada",
"nos",
"vemos",
"despues",
"para",
"principio",
"que",
"qndo",
"saludos",
"siempre",
"estoy",
"tambien",
"por",
"pero",
"porque"
]
sms = [
"=",
"+",
"-",
"+a",
"a2",
"ad+",
"ak",
"bn",
"bno",
"grax",
"k",
"t",
"knto",
"nd",
"ns",
"vms",
"dsps",
"pa",
"ppio",
"q",
"qndo",
"salu2",
"100pre",
"stoi",
"tb",
"x",
"xo",
"xk"
]
toret = ""
ws = s.strip().lower().split()
for w in ws:
word_pos = list.index(words, w) if w in words else -1
if word_pos > -1:
toret += sms[word_pos]
else:
toret += w
...
toret += " "
...
return toret.strip()
...
print(sms_from_str("recuerda que te vas a por pan bien bueno"))
ZGVmIHNtc19mcm9tX3N0cihzOiBzdHIpIC0+IHN0cjoKCXdvcmRzID0gWwoJCSJpZ3VhbCIsCgkJIm1hcyIsCgkJIm1lbm9zIiwKCQkibWFzYSIsCgkJImFkaW9zIiwKCQkiYWRlbWFzIiwKCQkiYWNhIiwKCQkiYmllbiIsCgkJImJ1ZW5vIiwKCQkiZ3JhY2lhcyIsCgkJInF1ZSIsCgkJInRlIiwKCQkiY3VhbnRvIiwKCQkibmFkYSIsCgkJIm5vcyIsCgkJInZlbW9zIiwKCQkiZGVzcHVlcyIsCgkJInBhcmEiLAoJCSJwcmluY2lwaW8iLAoJCSJxdWUiLAoJCSJxbmRvIiwKCQkic2FsdWRvcyIsCgkJInNpZW1wcmUiLAoJCSJlc3RveSIsCgkJInRhbWJpZW4iLAoJCSJwb3IiLAoJCSJwZXJvIiwKCQkicG9ycXVlIgoJXQoJCglzbXMgPSBbCgkJIj0iLAoJCSIrIiwKCQkiLSIsCgkJIithIiwKCQkiYTIiLAoJCSJhZCsiLAoJCSJhayIsCgkJImJuIiwKCQkiYm5vIiwKCQkiZ3JheCIsCgkJImsiLAo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