letters / alphabet [terminology]
Terminology¶
Usage¶
- Use
alphabetfor the complete character set from which substitutions are generated. - Use
lettersfor a relevant collection of letters that may not be a complete alphabet. - Avoid generic
charswhen completeness or domain matters.
alphabet = "abcdefghijklmnopqrstuvwxyz"
while front:
# ...
for word in front:
for i, ch in enumerate(word):
for letter in alphabet:
if letter == ch:
continue
cand = word[:i] + letter + word[i + 1:]
# ...
See 127. Word Ladder.