I have a csv with all the words from the dictionary, and i want to have a function that given three characters, searches for all the words from the csv that contain the given characters in the given order.
def read_words(registro):
with open(file, encoding="utf-8") as f:
lector = csv.reader(f)
palabras = [p for p in lector]
return palabras
file= ("Diccionario.csv")
register = read_words(file)
def search_for_words_with(register, a, b, c):
res = []
for w in register:
if a in w:
if b in w:
if c in w:
res.append(w)
return res
search_for_words_with, for example, you could give us a hard-codedregisterarray and a call to the function that illustrates the problem.firstchar.*secondchar.*thirdchar