Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import codecs
  2.  
  3. # http://natura.di.uminho.pt/download/sources/Dictionaries/wordlists/
  4. words = codecs.open("wordlist.txt", "r", "iso8859-1").readlines()
  5. valid = set()
  6.  
  7. for w in words:
  8.     w = w.strip().lower()
  9.     valid.add(w)
  10.     reversed_word = "".join(reversed(w))
  11.     if reversed_word in valid:
  12.         print(w, "<=>", reversed_word)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement