>>> from string import punctuation
>>> text = "he is the boy."
>>> word1 = ('a','b','c','d','e','f','g','h','i','j','k','l','m')
>>> word2 = ('z','y','x','w','v','u','t','s','r','q','p','o','n')
>>> d = dict(zip(word1 + word2, word2 + word1))
>>> words = (w.strip(punctuation) for w in text.split())
>>> [w for w in words if d[w[0]] == w[-1]]
['boy']