Semordnilap: Difference between revisions
Content added Content deleted
(remove the second mention of phrases) |
m (→Idiomatic: what exactly is wrong with "word" that we have to spell it "wrd" ?) |
||
Line 2,624: | Line 2,624: | ||
>>> revlist = (''.join(word[::-1]) for word in wordset) |
>>> revlist = (''.join(word[::-1]) for word in wordset) |
||
>>> pairs = set(( |
>>> pairs = set((word, rev) for word, rev in zip(wordset, revlist) |
||
if |
if word < rev and rev in wordset) |
||
>>> len(pairs) |
>>> len(pairs) |
||
158 |
158 |