Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 7th, 2020 174 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #python program to unscramble a list of words given the list of unscrambled words  
  2. scrambled_words = ['AKSDO','ETECRHLVO', 'LPOE','IDAU','UZIUS','UCRAA','RBSUAU','RGAJUA', 'PEJE','AZMAD', 'IMNI','DOVLNARRE', 'SLXEU', 'BASA','UPETOGE', 'UTLARNE','ONTRPO','EDWOAO','TIOCNER','GNOYAGSNS', 'ALICALDC','IATF', 'RASONTATNIM', 'ESEDRMCE', 'MHCOI', 'NLACMER', 'TIINIIFN', 'TSOLU', 'LNETEBY', 'IRATASME', 'RFEIARR', 'DHNOA','SNNSIA', 'AAVLH','RFDO','OLOVV', 'ETSA', 'YTOTAO','UODPREA', 'ELGYE','HSIBUSIMIT', 'OOEMRFAAL', 'HAIATDUS', 'GNEOVSKLWA', 'CEHSRPO', 'NIADYHU', 'ITABGTU', 'MBALNIHGROI', 'CRLOSEORYL','IKZSUU','SAELT']    
  3.  
  4. with open("Newt.txt", 'r') as wlist:
  5.     unscrambled_words = wlist.read().split("\n")  
  6.  
  7. signatures = dict()
  8.  
  9. #looping through the list of unscrambled words
  10. for word in unscrambled_words:
  11.     #sorts the list of unscrambled words into ASCII order(i.e; AKSDO --> ADKOS) and removes whitespaces
  12.     s_word = ''.join(sorted(word.upper().replace(' ','')))
  13.  
  14.     #storing the sorted list in a dictionary, this gives each word in the unscrambled_list
  15.     #a signature and pairs it with its matching signature in the scrambled_list
  16.     signatures[s_word] = word
  17.  
  18. found_words = []
  19. #looping through list of scrambled words
  20. #sword = scrambled word
  21. for sword in scrambled_words:
  22.     s_word = ''.join(sorted(sword))
  23.     if s_word in signatures:
  24.         found_words.append(signatures[s_word])
  25.     else:
  26.         pass
  27.     print(scrambled_words.index(sword) + 1,'.' , sword, '=', signatures[s_word].title())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top