from io import TextIOWrapper DICTIONARY_FILE: str = '07/dictionary.txt' def get_dictionary() -> list[str]: words: list[str] = [] f: TextIOWrapper = open(DICTIONARY_FILE) for word in f.readlines(): word = word.strip() words.append(word) f.close() return words def get_wordle_dictionary(word_length: int) -> list[str]: words: list[str] = [] for word in get_dictionary(): if len(word) == word_length: words.append(word) return words