6 ms·
Looking at your Python script. Might want to learn about the built-in set() functionality. For exmaple: def uniqueletters(s): return set(c for c in s) def int
by ttttannebaum 15y ago
Looking at your Python script. Might want to learn about the built-in set() functionality. For exmaple:
def uniqueletters(s): return set(c for c in s)
def intersect(word, charlist): return len(uniqueletters(word).intersection(charlist))
- ttttannebaum 15y agoIn fact: max(wordlist, key=(lambda w: intersect(w, charlist)) should replace a good portion of the create_mnemonic function. But now I'm just showing off. Just letting you know that Python is much cooler than you know. Haskell, however, could probably do this in a few lines.
- zephod 15y agoI've got a pull request sitting on GitHub showing me exactly this. Awesome! I'm about eight months into Python but my knowledge isn't particularly deep.